Package openllet.core.utils.intset
Class ArrayIntSet
- java.lang.Object
-
- openllet.core.utils.intset.ArrayIntSet
-
-
Constructor Summary
Constructors Constructor Description ArrayIntSet()
ArrayIntSet(int[] others)
ArrayIntSet(ArrayIntSet other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int value)
Adds a new integer to this set.void
addAll(IntSet values)
Adds all the integers from another set to this set.boolean
contains(int value)
Checks if the given integer value is in this set.IntSet
copy()
Creates a copy of this set.boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isEmpty()
Cehcks if the set is empty.IntIterator
iterator()
An iterator over the values of this set.int
max()
Returns the maximum integer in this set.int
min()
Returns the minimum integer in this set.void
remove(int value)
Remove the given integer value from this set.int
size()
Returns the number of elements in the set.java.lang.String
toString()
IntSet
union(IntSet values)
Creates a new IntSet that is the union of this set and the given set.
-
-
-
Constructor Detail
-
ArrayIntSet
public ArrayIntSet()
-
ArrayIntSet
public ArrayIntSet(ArrayIntSet other)
-
ArrayIntSet
public ArrayIntSet(int[] others)
-
-
Method Detail
-
add
public void add(int value)
Adds a new integer to this set.
-
addAll
public void addAll(IntSet values)
Adds all the integers from another set to this set.
-
contains
public boolean contains(int value)
Checks if the given integer value is in this set.
-
copy
public IntSet copy()
Creates a copy of this set.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
isEmpty
public boolean isEmpty()
Cehcks if the set is empty.
-
iterator
public IntIterator iterator()
An iterator over the values of this set. There is no guarantee on the _order of the elements.
-
max
public int max()
Returns the maximum integer in this set.
-
min
public int min()
Returns the minimum integer in this set.
-
remove
public void remove(int value)
Remove the given integer value from this set.
-
size
public int size()
Returns the number of elements in the set.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-