Interface Index.SequentialBuilder

All Superinterfaces:
LongRangeConsumer, gnu.trove.procedure.TLongProcedure
Enclosing interface:
Index

public static interface Index.SequentialBuilder
extends gnu.trove.procedure.TLongProcedure, LongRangeConsumer
An builder for Indexs that requires keys to be added in a monotonically increasing fashion. These builders are optimized for patterns where this is true.
  • Method Details

    • setDomain

      default void setDomain​(long minKey, long maxKey)
      No obligation to call, but if called, (a) should be called before providing any values, and (b) no value should be provided outside of the domain. Implementations may be able to use this information to improve memory utilization. Either of the arguments may be given as Index.NULL_KEY, indicating that the respective value is not known.
      Parameters:
      minKey - the minimum key to be provided, or Index.NULL_KEY if not known.
      maxKey - the maximum key to be provided, or Index.NULL_KEY if not known.
    • getIndex

      Index getIndex()
      Get the index constructed from all of the keys added so far.
      Returns:
      an Index
    • appendKey

      void appendKey​(long key)
      Append the specified key to the builder.
      Parameters:
      key - the key
    • appendRange

      void appendRange​(long rangeFirstKey, long rangeLastKey)
      Append the specified range of keys to the builder.
      Parameters:
      rangeFirstKey - the first key in the range (inclusive)
      rangeLastKey - the last key in the range (inclusive)
    • appendKeys

      default void appendKeys​(PrimitiveIterator.OfLong it)
      Append a set of keys from the provided long iterator.
      Parameters:
      it - the iterator
    • appendOrderedKeyIndicesChunk

      default void appendOrderedKeyIndicesChunk​(LongChunk<Attributes.OrderedKeyIndices> chunk)
      Append all of the keys from the specified Attributes.OrderedKeyIndices.
      Parameters:
      chunk - the chunk of ordered indices
    • appendRanges

      default void appendRanges​(LongRangeIterator it)
      Append all of the ranges from the specified LongRangeIterator.
      Parameters:
      it - the long range iterator
    • appendOrderedKeyRangesChunk

      default void appendOrderedKeyRangesChunk​(LongChunk<Attributes.OrderedKeyRanges> chunk)
      Append a chunk of ordered ranges.
      Parameters:
      chunk - the chunk
    • execute

      default boolean execute​(long value)
      Append the specified value to the builder.
      Specified by:
      execute in interface gnu.trove.procedure.TLongProcedure
      Parameters:
      value - the value
      Returns:
      true always
    • appendIndex

      default void appendIndex​(ReadOnlyIndex idx)
      Append the entire ReadOnlyIndex to this builder
      Parameters:
      idx - the index
    • appendIndexWithOffset

      default void appendIndexWithOffset​(ReadOnlyIndex idx, long offset)
      Appends the index shifted by the provided offset to this builder.
      Parameters:
      idx - The index to append.
      offset - An offset to apply to every range in the index.
    • appendOrderedKeys

      default void appendOrderedKeys​(OrderedKeys orderedKeys)
      Append the entire set of ordered keys by range to this builder.
      Parameters:
      orderedKeys - the ordered keys to add