Package org.apache.solr.util
Class LongSet
- java.lang.Object
-
- org.apache.solr.util.LongSet
-
public class LongSet extends Object
Collects long values in a hash set (closed hashing on power-of-two sized long[])- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
-
Constructor Summary
Constructors Constructor Description LongSet(int sz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(long val)Adds an additional value to the setintcardinality()The number of values in the setbooleancontainsZero()long[]getBackingArray()Returns the long[] array that has entries filled in with values or "0" for empty.LongIteratoriterator()Returns an iterator over the values in the set.
-
-
-
Method Detail
-
getBackingArray
public long[] getBackingArray()
Returns the long[] array that has entries filled in with values or "0" for empty. To see if "0" itself is in the set, call containsZero()
-
containsZero
public boolean containsZero()
-
add
public void add(long val)
Adds an additional value to the set
-
cardinality
public int cardinality()
The number of values in the set
-
iterator
public LongIterator iterator()
Returns an iterator over the values in the set.
-
-