Interface LongHashTable

All Superinterfaces:
AutoCloseable, Closeable, Releasable
All Known Implementing Classes:
LongHash

public interface LongHashTable extends Releasable
A hash table mapping keys (primitive long type) to values to ids, also of primitive long type. The id's start at 0, and increment monotonically as unique keys are added.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    add(long key)
    Adds the given key to the table.
    long
    find(long key)
    Finds the id associated with the given key, or -1 is the key is not contained in the hash.
    long
    get(long id)
    Gets a key from the given id value.
    long
    Returns the size (number of key/value pairs) in the table.

    Methods inherited from interface org.elasticsearch.core.Releasable

    close
  • Method Details

    • get

      long get(long id)
      Gets a key from the given id value.
    • find

      long find(long key)
      Finds the id associated with the given key, or -1 is the key is not contained in the hash.
    • add

      long add(long key)
      Adds the given key to the table. Return its newly allocated id if it wasn't in the table yet, or -1-id if it was already present in the table.
    • size

      long size()
      Returns the size (number of key/value pairs) in the table.