|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.inxar.syntacs.util.EmptyIntSet
Concrete implementation of IntSet
which may never contain
elements. Used when a IntSet
will always be empty and
you want to conserve memory. Any attempt to modify the set will
result in a RuntimeException
.
Field Summary | |
static IntSet |
EMPTY_SET
Returns a statically cached copy of the EmptyIntSet . |
Method Summary | |
int |
at(int index)
Returns the value at the given index. |
Object |
clone()
Clones the IntSet . |
boolean |
contains(int id)
Returns true if the given value is already in this
IntSet . |
boolean |
equals(Object other)
|
int |
hashCode()
|
boolean |
hasNext()
Returns true if there is at least one more
element, false otherwise (at the end of the list). |
boolean |
isEmpty()
Returns true if there are no members in this
IntSet (the empty set). |
IntIterator |
iterator()
Returns an IntIterator view of the members in the
IntSet . |
int |
length()
Returns the length of the array. |
int |
next()
Moves the index pointer forward by one and returns the value at that position. |
void |
put(int id)
Puts the given int value in the IntSet . |
void |
put(IntIterator iter)
|
int |
size()
Returns the number of members in this IntSet . |
int[] |
toArray()
Returns a new primitive-typed copy of the array. |
IntArray |
toIntArray()
Returns the list of set members as an IntArray . |
String |
toString()
|
void |
union(IntSet other)
All the members of the given other IntSet are added
to this IntSet . |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final IntSet EMPTY_SET
EmptyIntSet
.Method Detail |
public boolean contains(int id)
IntSet
true
if the given value is already in this
IntSet
.contains
in interface IntSet
public boolean isEmpty()
IntSet
true
if there are no members in this
IntSet
(the empty set).isEmpty
in interface IntSet
public void put(int id)
IntSet
int
value in the IntSet
.put
in interface IntSet
public void put(IntIterator iter)
public IntIterator iterator()
IntSet
IntIterator
view of the members in the
IntSet
.iterator
in interface IntSet
public void union(IntSet other)
IntSet
IntSet
are added
to this IntSet
.union
in interface IntSet
public int size()
IntSet
IntSet
.size
in interface IntSet
public int length()
IntArray
length
in interface IntArray
public int at(int index)
IntArray
at
in interface IntArray
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public IntArray toIntArray()
IntSet
IntArray
.toIntArray
in interface IntSet
public int[] toArray()
IntArray
toArray
in interface IntArray
public String toString()
toString
in class Object
public Object clone() throws CloneNotSupportedException
IntSet
IntSet
.clone
in interface IntSet
public boolean hasNext()
IntIterator
true
if there is at least one more
element, false
otherwise (at the end of the list).hasNext
in interface IntIterator
public int next()
IntIterator
next
in interface IntIterator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |