Interface IntSet
- All Known Implementing Classes:
BitIntSet, ListIntSet
public interface IntSet
A set of integers
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int value) Adds an int to a setintelements()Returns the count of unique elements in this set.booleanhas(int value) Checks to see if a value is in the setiterator()Iterates the setvoidMergesotherinto this set, so this set becomes the union of the two.voidremove(int value) Removes an int from a set.
-
Method Details
-
add
void add(int value) Adds an int to a set- Parameters:
value- int to add
-
remove
void remove(int value) Removes an int from a set.- Parameters:
value- int to remove
-
has
boolean has(int value) Checks to see if a value is in the set- Parameters:
value- int to check- Returns:
- true if in set
-
merge
Mergesotherinto this set, so this set becomes the union of the two.- Parameters:
other-non-null;other set to merge with.
-
elements
int elements()Returns the count of unique elements in this set.- Returns:
> = 0;count of unique elements
-
iterator
-