public class IntArraySet extends java.lang.Object implements java.io.Serializable, IntSet
?????? | ????? |
---|---|
static int[] |
EMPTY_INT_ARRAY |
?????? |
---|
IntArraySet()
Create an empty set
|
IntArraySet(IntArraySet input)
Create one IntArraySet as a copy of another
|
IntArraySet(IntHashSet input)
Create a set containing integers from the specified IntHashSet
|
?????? | ????? |
---|---|
boolean |
add(int value)
Add an integer to the set
|
void |
clear()
Clear the contents of the IntSet (making it an empty set)
|
boolean |
contains(int value)
Determine whether a particular integer is present in the set
|
boolean |
containsAll(IntSet other)
Test if this set is a superset of another set
|
boolean |
equals(java.lang.Object other)
Test whether this set has exactly the same members as another set
|
int |
getFirst()
Get the first value in the set.
|
int[] |
getValues()
Get the set of integer values as an array
|
int |
hashCode()
Construct a hash key that supports the equals() test
|
boolean |
isEmpty()
Determine if the set is empty
|
IntIterator |
iterator()
Get an iterator over the values
|
static IntArraySet |
make(int[] in,
int size)
Factory method to construct a set from an array of integers
|
boolean |
remove(int value)
Remove an integer from the set
|
int |
size()
Get the number of integers in the set
|
java.lang.String |
toString() |
IntArraySet |
union(IntArraySet other)
Form a new set that is the union of this set with another set.
|
public IntArraySet()
public IntArraySet(IntHashSet input)
input
- the set to be copiedpublic IntArraySet(IntArraySet input)
input
- the set to be copiedpublic void clear()
IntSet
public int size()
IntSet
public boolean isEmpty()
IntSet
public int[] getValues()
public boolean contains(int value)
IntSet
public boolean remove(int value)
IntSet
public boolean add(int value)
public int getFirst()
java.lang.ArrayIndexOutOfBoundsException
- if the set is emptypublic IntIterator iterator()
public IntArraySet union(IntArraySet other)
other
- the other setpublic static IntArraySet make(int[] in, int size)
in
- the array of integers, which must be in ascending ordersize
- the number of elements in the array that are significantpublic java.lang.String toString()
toString
??? java.lang.Object
public boolean equals(java.lang.Object other)
equals
??? java.lang.Object
public int hashCode()
hashCode
??? java.lang.Object
public boolean containsAll(IntSet other)
containsAll
???? IntSet