Interface Index.Factory

All Known Implementing Classes:
AbstractFactory
Enclosing interface:
Index

public static interface Index.Factory
A class for creating Indexs in various ways.
  • Method Details

    • getIndexByValues

      Index getIndexByValues​(long... keys)
      Get an Index containing the specified keys. All keys must be positive numbers
      Parameters:
      keys - The keys to add to the index
      Returns:
      An index containing the specified keys
    • getEmptyIndex

      Index getEmptyIndex()
      Get an empty index.
      Returns:
      an empty index
    • getIndexByValues

      Index getIndexByValues​(long key)
      Produce an index containing a single key.
      Parameters:
      key - the key that will exist in the new Index
      Returns:
      a new Index containing key
    • getIndexByValues

      Index getIndexByValues​(gnu.trove.list.array.TLongArrayList list)
      Get an Index containing the specified keys. The provided list is sorted, and then passed to a sequential builder.
      Parameters:
      list - a Trove long array list; note that this list is mutated within the method
      Returns:
      an Index containing the values from list
    • getIndexByRange

      Index getIndexByRange​(long firstKey, long lastKey)
      Create an Index containing the continuous range [firstKey, lastKey]
      Parameters:
      firstKey - The first key in the continuous range
      lastKey - The last key in the continuous range
      Returns:
      An index containing the specified range
    • getFlatIndex

      Index getFlatIndex​(long size)
      Get a flat Index containing the range [0, size), or an empty index if the specified size is <= 0.
      Parameters:
      size - The size of the index to create
      Returns:
      A flat index containing the keys [0, size) or an empty index if the size is <= 0
    • getRandomBuilder

      Index.RandomBuilder getRandomBuilder()
      Returns:
      An IndexBuilder suitable for inserting ranges in no particular order.
    • getSequentialBuilder

      Index.SequentialBuilder getSequentialBuilder()
      Get a builder optimized for inserting keys sequentially.
      Returns:
      A builder optimized for inserting ranges sequentially in order.
    • getBuilder

      Index.RandomBuilder getBuilder()
      Get a builder capable of inserting keys in any random order.
      Returns:
      a builder capable of inserting keys in any random order.