|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.sort.IntArraySet
public class IntArraySet
Set of int values. This class is modelled on the java.net.Set interface, but it does not implement this interface, because the set members are int's rather than Objects. It does implement the same interface as IntHashSet, although this is currently not defined as an explicit interface.
This implementation of a set of integers is optimized to use very little storage and to provide fast comparison of two sets. The equals() method determines whether two sets contain the same integers. Not thread safe.
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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(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()
|
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)
|
boolean |
remove(int value)
Remove an integer from the set |
int |
size()
Get the number of integers in the set |
String |
toString()
|
IntArraySet |
union(IntArraySet other)
Form a new set that is the union of this set with another set. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IntArraySet()
public IntArraySet(IntHashSet input)
public IntArraySet(IntArraySet input)
Method Detail |
---|
public void clear()
IntSet
clear
in interface IntSet
public int size()
IntSet
size
in interface IntSet
public boolean isEmpty()
IntSet
isEmpty
in interface IntSet
public int[] getValues()
public boolean contains(int value)
IntSet
contains
in interface IntSet
value
- the integer under test
public boolean remove(int value)
IntSet
remove
in interface IntSet
value
- the integer to be removed
public boolean add(int value)
add
in interface IntSet
value
- the integer to be added
public int getFirst()
ArrayIndexOutOfBoundsException
- if the set is emptypublic IntIterator iterator()
iterator
in interface IntSet
public IntArraySet union(IntArraySet other)
public static IntArraySet make(int[] in, int size)
public String toString()
toString
in class Object
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public boolean containsAll(IntSet other)
containsAll
in interface IntSet
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |