- All Superinterfaces:
org.apache.lucene.util.Accountable,AutoCloseable,Closeable,Releasable
- All Known Implementing Classes:
LongLongHash
A hash table mapping keys (pair of primitive longs) to values to ids, also
of primitive long type. The id's start at 0, and increment monotonically as
unique keys are added.
-
Field Summary
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Method Summary
Modifier and TypeMethodDescriptionlongadd(long key1, long key2) Adds the given key pair to the table.longfind(long key1, long key2) Finds the id associated with the given key pair, or -1 is the key pair is not contained in the hash.longgetKey1(long id) Gets the first key from the given id value.longgetKey2(long id) Gets the second key from the given id value.longsize()Returns the size (number of key/value pairs) in the table.Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsedMethods inherited from interface org.elasticsearch.core.Releasable
close
-
Method Details
-
getKey1
long getKey1(long id) Gets the first key from the given id value. -
getKey2
long getKey2(long id) Gets the second key from the given id value. -
find
long find(long key1, long key2) Finds the id associated with the given key pair, or -1 is the key pair is not contained in the hash. -
add
long add(long key1, long key2) Adds the given key pair to the table. Return its newly allocated id if it wasn't in the table yet, or-1-idif it was already present in the table. -
size
long size()Returns the size (number of key/value pairs) in the table.
-