Class AbstractFactory

java.lang.Object
com.illumon.iris.db.v2.utils.AbstractFactory
All Implemented Interfaces:
Index.Factory

public abstract class AbstractFactory
extends Object
implements Index.Factory
This is the base class for factories that construct Indexes.
  • Constructor Details

  • Method Details

    • getIndexByValues

      public Index getIndexByValues​(long... keys)
      Description copied from interface: Index.Factory
      Get an Index containing the specified keys. All keys must be positive numbers
      Specified by:
      getIndexByValues in interface Index.Factory
      Parameters:
      keys - The keys to add to the index
      Returns:
      An index containing the specified keys
    • getIndexByValues

      public Index getIndexByValues​(long key)
      Description copied from interface: Index.Factory
      Produce an index containing a single key.
      Specified by:
      getIndexByValues in interface Index.Factory
      Parameters:
      key - the key that will exist in the new Index
      Returns:
      a new Index containing key
    • getIndexByValues

      public Index getIndexByValues​(gnu.trove.list.array.TLongArrayList list)
      Description copied from interface: Index.Factory
      Get an Index containing the specified keys. The provided list is sorted, and then passed to a sequential builder.
      Specified by:
      getIndexByValues in interface Index.Factory
      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

      public Index getIndexByRange​(long firstKey, long lastKey)
      Description copied from interface: Index.Factory
      Create an Index containing the continuous range [firstKey, lastKey]
      Specified by:
      getIndexByRange in interface Index.Factory
      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

      public Index getFlatIndex​(long size)
      Description copied from interface: Index.Factory
      Get a flat Index containing the range [0, size), or an empty index if the specified size is <= 0.
      Specified by:
      getFlatIndex in interface Index.Factory
      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