public class ObjectSet extends RuntimeSet implements Sliceable
| Constructor and Description |
|---|
ObjectSet()
Constructs a new empty set.
|
ObjectSet(ObjectToIntMap map)
Constructs a new set with the elements of the specified map.
|
| 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 |
addObject(java.lang.Object element)
Adds the specified Object to this set if it does not already belong to this set.
|
java.lang.Object[] |
array()
Returns the inverse relation of the index map as an array.
|
IntIterator |
backwardIntIterator()
Returns an iterator of unboxed ints over the boxed int elements of this set
in the reverse order of its indices.
|
java.util.Iterator |
backwardIterator()
Returns an iterator of objects over the elements of this set in the reverse order
of its indices.
|
DoubleIterator |
backwardRealIterator()
Returns an iterator of unboxed doubles over the boxed double elements of this set
in the reverse order of its indices.
|
boolean |
contains(double element)
Returns true iff any boxed wrapper of the specified double belongs
to this set.
|
boolean |
contains(int element)
Returns true iff any boxed wrapper of the specified int belongs
to this set.
|
boolean |
contains(java.lang.Object element)
Returns true iff this set contains the specified object.
|
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 a boxed wrapper of the specified double if such an
object belongs to this set, otherwise -1.
|
int |
getIndex(int element)
Returns the index of a boxed wrapper of the specified int if such an
object belongs to this set, otherwise -1.
|
int |
getIndex(java.lang.Object element)
Returns the index of specified object if it belongs to this set,
otherwise -1.
|
ObjectSet |
getSlice(java.lang.Object slicer) |
IntIterator |
indexIterator()
Returns an iterator for the indices of the elements of this set.
|
IntIterator |
intIterator()
Returns an iterator of the int values over the boxed int elements of this set.
|
IntIterator |
intIterator(boolean ordered)
Returns an iterator of the int values over the boxed int 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 for this set.
|
java.util.Iterator |
iterator(boolean ordered)
Returns an iterator 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.
|
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.
|
java.util.Iterator |
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 the double values over the boxed double elements of
this set.
|
DoubleIterator |
realIterator(boolean ordered)
Returns an iterator of the double values over the boxed double elements of
this set.
|
void |
slice(int[] slice) |
java.util.Iterator |
sliceIterator(int[][] slices,
java.lang.Object[] slicers) |
java.lang.String |
toString() |
public ObjectSet()
public ObjectSet(ObjectToIntMap map)
public final java.lang.Object[] 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(java.lang.Object element)
public final int getIndex(int element)
public final int getIndex(double element)
public final void addObject(java.lang.Object element)
public final boolean contains(java.lang.Object element)
public final boolean contains(int element)
public final boolean contains(double 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 java.util.Iterator iterator(boolean ordered)
iterator in interface Iteratablepublic final java.util.Iterator iterator()
iterator in interface Iteratablepublic final IntIterator intIterator(boolean ordered)
intIterator in interface Iteratablepublic final IntIterator intIterator()
intIterator in interface Iteratablepublic final DoubleIterator realIterator(boolean ordered)
realIterator in interface Iteratablepublic final DoubleIterator realIterator()
realIterator in interface Iteratablepublic final java.util.Iterator orderedIterator()
public final java.util.Iterator backwardIterator()
backwardIterator in interface Iteratablepublic final IntIterator backwardIntIterator()
backwardIntIterator in interface Iteratablepublic final DoubleIterator backwardRealIterator()
backwardRealIterator in interface Iteratablepublic final IntIterator indexIterator()
indexIterator in interface Indexablepublic final void slice(int[] slice)
public final java.util.Iterator sliceIterator(int[][] slices,
java.lang.Object[] slicers)
sliceIterator in interface Sliceablepublic final ObjectSet getSlice(java.lang.Object slicer)
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