|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthealpix.core.base.set.LongCollection
healpix.core.base.set.LongSet
public class LongSet
In Java Collections this class corresponds to TreeSet of longs. Is sorted, and contains only unique values. But memory requirements are greatly optimized (1000x times)
This class represents bit array based sets of long values. When a bit in the underlying array is set, the value having the same number as the bit is contained in the array. This implies that bit sets cannot contain negative values.
To improve memory performance, bit array is based in slot by 1e6, so when one number is allocated at 1e10, only one slot of size 1e6 is consumed.
This class have very good IO speed and good memory consumption. But memory consumption is still linear, so for readonly sets LongRangeSet is better option
Constructor Summary | |
---|---|
LongSet()
|
|
LongSet(int slotSize)
|
|
LongSet(long[] set)
|
|
LongSet(LongCollection set)
|
|
LongSet(LongIterator longIterator)
|
Method Summary | |
---|---|
void |
add(long v)
Add value to set |
void |
clear()
remove all iterms from set |
boolean |
contains(long v)
|
boolean |
isEmpty()
Return true if set is empty. |
LongIterator |
longIterator()
|
void |
remove(long v)
remove given element from set |
int |
size()
Count elements in set. |
LongRangeSet |
toLongRangeSet()
|
Methods inherited from class healpix.core.base.set.LongCollection |
---|
addAll, addAll, addAll, addAll, addRange, iterator, toArray, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LongSet()
public LongSet(int slotSize)
public LongSet(LongCollection set)
public LongSet(long[] set)
public LongSet(LongIterator longIterator)
Method Detail |
---|
public void add(long v)
LongCollection
add
in class LongCollection
v
- value to addpublic void clear()
LongCollection
clear
in class LongCollection
public boolean contains(long v)
contains
in class LongCollection
v
- value
public LongIterator longIterator()
longIterator
in class LongCollection
public int size()
LongCollection
size
in class LongCollection
public void remove(long v)
LongCollection
remove
in class LongCollection
v
- to removepublic boolean isEmpty()
LongCollection
isEmpty
in class LongCollection
public LongRangeSet toLongRangeSet()
|
"Built from revision exported" | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |