public class IntSet extends RuntimeSet
| Constructor and Description |
|---|
IntSet()
Constructs a new empty set.
|
| Modifier and Type | Method and Description |
|---|---|
RuntimeSet |
_exclusion(RuntimeSet set)
Returns this set modified to contain the symmetric difference of this and the specified set.
|
RuntimeSet |
_intersection(RuntimeSet set)
Returns this set modified to contain the intersection of this and the specified set.
|
RuntimeSet |
_minus(RuntimeSet set)
Returns this set modified to contain the set difference of this and the specified set.
|
void |
_recomputeMax()
Recomputes the maximum element.
|
void |
_recomputeMin()
Recomputes the minimum element.
|
void |
addInt(int element)
Adds the specified int to this set if it does not already belong to this set.
|
int[] |
array()
Returns the inverse relation of the index map as an array.
|
IntIterator |
backwardIntIterator()
Returns an iterator of ints over the elements of this set in the reverse order
of its indices.
|
java.util.Iterator |
backwardIterator()
Returns an iterator of boxed ints for this set in the reverse order
of its indices.
|
DoubleIterator |
backwardRealIterator()
Returns an iterator of doubles over the elements of this set cast as doubles
in the reverse order of its indices.
|
boolean |
contains(double element)
Returns true iff the specified double cast as an int belongs to this set.
|
boolean |
contains(int element)
Returns true iff the specified int belongs to this set.
|
boolean |
contains(java.lang.Object element)
Returns true iff this set contains the value of the given boxed int.
|
boolean |
contains(RuntimeSet set)
Returns true iff this set contains all the elements of the specified set.
|
RuntimeSet |
copy()
Returns a copy of this set.
|
boolean |
equals(java.lang.Object object)
Returns true when this set is equal (as a set) to the specified object.
|
boolean |
equals(java.lang.Object object,
int[] permutation)
Returns true when this set is equal (as a set) to the specified object,
with a side-effect on the specified array of ints that will contain the index
permutation when the sets are found to be equal.
|
int |
firstInt()
Returns the first element of this set as an int.
|
java.lang.Object |
firstObject()
Returns the first element of this set as an object.
|
double |
firstReal()
Returns the first element of this set as a double.
|
int |
getIndex(double element)
Returns the index of the specified double cast as an int if such a
value belongs to this set, otherwise -1.
|
int |
getIndex(int element)
Returns the index of the specified int if it belongs to this set,
otherwise -1.
|
int |
getIndex(java.lang.Object element)
Returns the index of the int value of specified boxed int if it belongs
to this set, otherwise -1.
|
IntIterator |
indexIterator()
Returns an iterator for the indices of the elements of this set.
|
IntIterator |
intIterator()
Returns an iterator of ints over the elements of this set.
|
IntIterator |
intIterator(boolean ordered)
Returns an iterator of ints over the elements of this set such that whenever
the specified boolean is true, iteration will be respecting the
index order of the elements; otherwise, order of iteration is unpredictable.
|
java.util.Iterator |
iterator()
Returns an iterator of boxed ints for this set.
|
java.util.Iterator |
iterator(boolean ordered)
Returns an iterator of boxed ints for this set such that whenever the
specified boolean is true, iteration will be respecting the index
order of the elements; otherwise, order of iteration is unpredictable.
|
int |
lastInt()
Returns the last element of this set as an int.
|
java.lang.Object |
lastObject()
Returns the last element of this set as an object.
|
double |
lastReal()
Returns the last element of this set as a double.
|
int |
max()
Returns the greatest element of this set.
|
int |
min()
Returns the least element of this set.
|
double |
next(double element)
Returns the element following the given one in this set, as a double.
|
int |
next(int element)
Returns the element following the given one in this set, as an int.
|
java.lang.Object |
next(java.lang.Object element)
Returns the element following the given one in this set, as an object.
|
double |
nextc(double element)
Returns the element following the given one in this set, as a double,
wrapping back to the beginning if necessary.
|
int |
nextc(int element)
Returns the element following the given one in this set, as an int,
wrapping back to the beginning if necessary.
|
java.lang.Object |
nextc(java.lang.Object element)
Returns the element following the given one in this set, as an object,
wrapping back to the beginning if necessary.
|
int |
ord(double element)
Returns the position of given double if it is an element of this set.
|
int |
ord(int element)
Returns the position of given int if it is an element of this set.
|
int |
ord(java.lang.Object element)
Returns the position of given object if it is an element of this set.
|
IntIterator |
orderedIterator()
Returns an iterator of ints over the elements of this set in the order of
its indices.
|
double |
prev(double element)
Returns the element preceding the given one in this set, as a double.
|
int |
prev(int element)
Returns the element preceding the given one in this set, as an int.
|
java.lang.Object |
prev(java.lang.Object element)
Returns the element preceding the given one in this set, as an object.
|
double |
prevc(double element)
Returns the element preceding the given one in this set, as a double,
wrapping to last element if necessary.
|
int |
prevc(int element)
Returns the element preceding the given one in this set, as an int,
wrapping to last element if necessary.
|
java.lang.Object |
prevc(java.lang.Object element)
Returns the element preceding the given one in this set, as an object,
wrapping to last element if necessary.
|
DoubleIterator |
realIterator()
Returns an iterator of doubles over the elements of this set cast as doubles.
|
DoubleIterator |
realIterator(boolean ordered)
Returns an iterator of doubles over the elements of this set cast as doubles
such that whenever the specified boolean is true, iteration will be
respecting the index order of the elements; otherwise, order of iteration is
unpredictable.
|
IntRange |
toIntRange()
Returns an int range whose lower (resp., upper) bound is this set's miminum (resp.,
maximum) element.
|
java.lang.String |
toString() |
public final int[] array()
public final int firstInt()
throws NoSuchElementException
firstInt in class RuntimeSetNoSuchElementExceptionpublic final double firstReal()
throws NoSuchElementException
firstReal in class RuntimeSetNoSuchElementExceptionpublic final java.lang.Object firstObject()
throws NoSuchElementException
firstObject in class RuntimeSetNoSuchElementExceptionpublic final int lastInt()
throws NoSuchElementException
lastInt in class RuntimeSetNoSuchElementExceptionpublic final double lastReal()
throws NoSuchElementException
lastReal in class RuntimeSetNoSuchElementExceptionpublic final java.lang.Object lastObject()
throws NoSuchElementException
lastObject in class RuntimeSetNoSuchElementExceptionpublic final int ord(int element)
throws NoSuchElementException
ord in class RuntimeSetNoSuchElementExceptionpublic final int ord(double element)
throws NoSuchElementException
ord in class RuntimeSetNoSuchElementExceptionpublic final int ord(java.lang.Object element)
throws NoSuchElementException
ord in class RuntimeSetNoSuchElementExceptionpublic final int next(int element)
throws NoSuchElementException
next in class RuntimeSetNoSuchElementExceptionpublic final double next(double element)
throws NoSuchElementException
next in class RuntimeSetNoSuchElementExceptionpublic final java.lang.Object next(java.lang.Object element)
throws NoSuchElementException
next in class RuntimeSetNoSuchElementExceptionpublic final int prev(int element)
throws NoSuchElementException
prev in class RuntimeSetNoSuchElementExceptionpublic final double prev(double element)
throws NoSuchElementException
prev in class RuntimeSetNoSuchElementExceptionpublic final java.lang.Object prev(java.lang.Object element)
throws NoSuchElementException
prev in class RuntimeSetNoSuchElementExceptionpublic final int nextc(int element)
throws NoSuchElementException
nextc in class RuntimeSetNoSuchElementExceptionpublic final double nextc(double element)
throws NoSuchElementException
nextc in class RuntimeSetNoSuchElementExceptionpublic final java.lang.Object nextc(java.lang.Object element)
throws NoSuchElementException
nextc in class RuntimeSetNoSuchElementExceptionpublic final int prevc(int element)
throws NoSuchElementException
prevc in class RuntimeSetNoSuchElementExceptionpublic final double prevc(double element)
throws NoSuchElementException
prevc in class RuntimeSetNoSuchElementExceptionpublic final java.lang.Object prevc(java.lang.Object element)
throws NoSuchElementException
prevc in class RuntimeSetNoSuchElementExceptionpublic final RuntimeSet copy()
copy in class RuntimeSetpublic final int getIndex(int element)
public final int getIndex(double element)
public final int getIndex(java.lang.Object element)
public final int min()
public final int max()
public final void addInt(int element)
public final boolean contains(int element)
public final boolean contains(double element)
public final boolean contains(java.lang.Object element)
public final boolean contains(RuntimeSet set)
contains in class RuntimeSetpublic final RuntimeSet _intersection(RuntimeSet set)
public final RuntimeSet _minus(RuntimeSet set)
public final RuntimeSet _exclusion(RuntimeSet set)
public final void _recomputeMin()
public final void _recomputeMax()
public final IntRange toIntRange()
public final IntIterator intIterator()
public final IntIterator intIterator(boolean ordered)
public final DoubleIterator realIterator(boolean ordered)
public final DoubleIterator realIterator()
public final java.util.Iterator iterator(boolean ordered)
public final java.util.Iterator iterator()
public final IntIterator orderedIterator()
public final IntIterator backwardIntIterator()
public final DoubleIterator backwardRealIterator()
public final java.util.Iterator backwardIterator()
public final IntIterator indexIterator()
public final boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic final boolean equals(java.lang.Object object,
int[] permutation)
equals in interface Indexableequals in class RuntimeSetpublic final java.lang.String toString()
toString in class java.lang.Object