|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.emory.mathcs.util.collections.longs.AbstractLongCollection
edu.emory.mathcs.util.collections.longs.AbstractLongSet
edu.emory.mathcs.util.collections.longs.AbstractLongSortedSet
edu.emory.mathcs.util.collections.longs.LongIntervalSet
Set of long numbers that is optimized towards clustered distributions. The implementation keeps the atomic information about intervals of numbers, hence this set can hold billions of elements as long as they form clusters (long consecutive runs). The main application of this class is in collision detection arrays, e.g. to aid in generation of unique IDs that are roughly sequential but possibly cyclic (process IDs, packet IDs) with ID recycling and gap filling.
Caution: descending iterators aren't particularly well tested.
| Nested Class Summary |
| Nested classes inherited from class edu.emory.mathcs.util.collections.longs.AbstractLongSortedSet |
AbstractLongSortedSet.AbstractComplementSubView, AbstractLongSortedSet.AbstractSubView, AbstractLongSortedSet.ForwardIntervalItemIterator, AbstractLongSortedSet.ReverseIntervalItemIterator |
| Constructor Summary | |
LongIntervalSet()
Creates a new set of longs. |
|
LongIntervalSet(LongCollection c)
|
|
LongIntervalSet(long min,
long max)
|
|
LongIntervalSet(LongSet c)
|
|
| Method Summary | |
boolean |
add(long n)
Adds an element to the set if it is not already present. |
boolean |
addAll(LongCollection c)
Adds all of the elements in the specified collection to this set if they're not already present, and if they fall within this set's domain. |
boolean |
addInterval(long first,
long last)
Adds to this set all the numbers between first and last, inclusive, that are not already present in this set and belong to this set's domain. |
long |
ceiling(long n)
Returns the smallest number in this set >= e. |
LongInterval |
ceilingInterval(long n)
Returns the smallest (left-most), widest interval contained in this set which elements are not all smaller than the specified number. |
void |
clear()
Removes all elements from the set. |
LongSet |
complementSet()
Returns a complement view of this set. |
boolean |
contains(long n)
Checks whether the set contains a given element |
boolean |
containsInterval(long first,
long last)
Returns true if this set contains all the numbers between first and last, inclusive; false otherwise. |
java.util.Iterator |
descendingIntervalIterator()
Returns an iterator over intervals of this set, in a decreasing numerical order. |
LongIterator |
descendingIterator()
Returns an iterator over numbers in this set, in a decreasing numerical order. |
LongInterval |
enclosingInterval(long e)
Returns the widest interval contained in this set that includes the specified number, or null if this set does not include the specified number. |
long |
first()
Returns the smallest number in this set. |
LongInterval |
firstInterval()
Returns the first (left-most), widest interval contained in this set, or null if this set is empty. |
long |
floor(long n)
Returns the largest number in this set <= e. |
LongInterval |
floorInterval(long n)
Returns the largest (right-most), widest interval contained in this set which elements are not all greater than the specified number. |
long |
higher(long n)
Returns the smallest number in this set > e. |
LongInterval |
higherInterval(long n)
Returns the smallest (left-most), widest interval contained in this set which all elements are strictly greater than the specified number. |
int |
intervalCount()
Returns the minimum count of intervals into which this set can be decomposed. |
java.util.Iterator |
intervalIterator()
Returns an iterator over intervals of this set, in an increasing numerical order. |
boolean |
isEmpty()
Returns true if this set is empty; false otherwise. |
LongIterator |
iterator()
Returns an iterator over numbers in this set, in an increasing numerical order. |
long |
last()
Returns the largest number in this set. |
LongInterval |
lastInterval()
Returns the last (right-most), widest interval contained in this set, or null if this set is empty. |
long |
lower(long n)
Returns the largest number in this set < e. |
LongInterval |
lowerInterval(long n)
Returns the largest and widest interval contained in this set which all elements are strictly less than the specified number. |
long |
max()
The largest number that can be stored in this set. |
long |
min()
The smallest number that can be stored in this set. |
long |
pollFirst()
Returns and removes the smallest number in this set. |
LongInterval |
pollFirstInterval()
Returns and removes the first (left-most), widest interval contained in this set, or null if this set is empty. |
long |
pollLast()
Returns and removes the largest number in this set. |
LongInterval |
pollLastInterval()
Returns and removes the last (right-most), widest interval contained in this set, or null if this set is empty. |
boolean |
remove(long n)
Removes the specified number from this set if it is present. |
boolean |
removeAll(LongCollection c)
Removes from this set all of its elements that are contained in the specified collection. |
boolean |
removeInterval(long first,
long last)
Removes from this set all the numbers between first and last, inclusive. |
long |
size64()
// PREPROC: Long,Int only Returns the number of elements in this set. |
LongSortedSet |
subSet(long first,
long last)
A subset view containing all elements from this set between first, inclusive, and last, inclusive. |
| Methods inherited from class edu.emory.mathcs.util.collections.longs.AbstractLongSortedSet |
headSet, retainAll, retainInterval, tailSet, toCompactString |
| Methods inherited from class edu.emory.mathcs.util.collections.longs.AbstractLongSet |
equals, hashCode |
| Methods inherited from class edu.emory.mathcs.util.collections.longs.AbstractLongCollection |
containsAll, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.emory.mathcs.util.collections.longs.LongSortedSet |
toString |
| Methods inherited from interface edu.emory.mathcs.util.collections.longs.LongSet |
containsAll, equals, hashCode, size, toArray, toArray |
| Constructor Detail |
public LongIntervalSet()
public LongIntervalSet(long min,
long max)
public LongIntervalSet(LongCollection c)
public LongIntervalSet(LongSet c)
| Method Detail |
public long min()
LongSet
min in interface LongSetmin in class AbstractLongSetpublic long max()
LongSet
max in interface LongSetmax in class AbstractLongSetpublic int intervalCount()
LongSortedSet
intervalCount in interface LongSortedSetintervalCount in class AbstractLongSortedSetpublic long size64()
LongSet
size64 in interface LongSetsize64 in class AbstractLongSortedSetpublic boolean isEmpty()
LongSet
isEmpty in interface LongSetisEmpty in class AbstractLongSortedSetpublic void clear()
clear in interface LongSetclear in class AbstractLongCollectionpublic boolean add(long n)
add in interface LongSetadd in class AbstractLongCollection
public boolean addInterval(long first,
long last)
LongSet
addInterval in interface LongSetaddInterval in class AbstractLongSetpublic boolean addAll(LongCollection c)
LongSet
addAll in interface LongSetaddAll in class AbstractLongSetpublic boolean remove(long n)
LongSet
remove in interface LongSetremove in class AbstractLongCollection
public boolean removeInterval(long first,
long last)
LongSet
removeInterval in interface LongSetremoveInterval in class AbstractLongSetpublic boolean removeAll(LongCollection c)
LongSet
removeAll in interface LongSetremoveAll in class AbstractLongSetpublic boolean contains(long n)
contains in interface LongSetcontains in class AbstractLongCollectionn - the element
public boolean containsInterval(long first,
long last)
LongSet
containsInterval in interface LongSetcontainsInterval in class AbstractLongSetpublic LongInterval enclosingInterval(long e)
LongSortedSet
enclosingInterval in interface LongSortedSetpublic long lower(long n)
LongSortedSet
lower in interface LongSortedSetlower in class AbstractLongSortedSetpublic long floor(long n)
LongSortedSet
floor in interface LongSortedSetfloor in class AbstractLongSortedSetpublic long higher(long n)
LongSortedSet
higher in interface LongSortedSethigher in class AbstractLongSortedSetpublic long ceiling(long n)
LongSortedSet
ceiling in interface LongSortedSetceiling in class AbstractLongSortedSetpublic java.util.Iterator intervalIterator()
LongSortedSet
intervalIterator in interface LongSortedSetpublic LongIterator iterator()
LongSortedSet
iterator in interface LongSortedSetiterator in class AbstractLongSortedSetpublic java.util.Iterator descendingIntervalIterator()
LongSortedSet
descendingIntervalIterator in interface LongSortedSetpublic LongIterator descendingIterator()
LongSortedSet
descendingIterator in interface LongSortedSetdescendingIterator in class AbstractLongSortedSetpublic long first()
LongSortedSet
first in interface LongSortedSetfirst in class AbstractLongSortedSetpublic long last()
LongSortedSet
last in interface LongSortedSetlast in class AbstractLongSortedSetpublic long pollFirst()
LongSortedSet
pollFirst in interface LongSortedSetpollFirst in class AbstractLongSortedSetpublic long pollLast()
LongSortedSet
pollLast in interface LongSortedSetpollLast in class AbstractLongSortedSetpublic LongInterval firstInterval()
LongSortedSet
firstInterval in interface LongSortedSetfirstInterval in class AbstractLongSortedSetpublic LongInterval lastInterval()
LongSortedSet
lastInterval in interface LongSortedSetlastInterval in class AbstractLongSortedSetpublic LongInterval ceilingInterval(long n)
LongSortedSet
ceilingInterval in interface LongSortedSetpublic LongInterval floorInterval(long n)
LongSortedSet
floorInterval in interface LongSortedSetpublic LongInterval higherInterval(long n)
LongSortedSet
higherInterval in interface LongSortedSetpublic LongInterval lowerInterval(long n)
LongSortedSet
lowerInterval in interface LongSortedSetpublic LongInterval pollFirstInterval()
LongSortedSet
pollFirstInterval in interface LongSortedSetpollFirstInterval in class AbstractLongSortedSetpublic LongInterval pollLastInterval()
LongSortedSet
pollLastInterval in interface LongSortedSetpollLastInterval in class AbstractLongSortedSet
public LongSortedSet subSet(long first,
long last)
LongSortedSet
subSet in interface LongSortedSetfirst - the minimum element of this view (inclusive).last - the maximum element of this view (inclusive).
public LongSet complementSet()
LongSet
complementSet in interface LongSetcomplementSet in class AbstractLongSet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||