Interface SingleRangeMixin

All Superinterfaces:
AutoCloseable, LongSizedDataStructure, RowSequence, SafeCloseable
All Known Implementing Classes:
SingleRangeRowSequence

public interface SingleRangeMixin extends RowSequence
This interface is really a mixin to avoid code duplication in the classes that implement it.
  • Method Details

    • forEachRowKey

      default boolean forEachRowKey(LongAbortableConsumer lc)
      Description copied from interface: RowSequence
      For as long as the consumer wants more row keys, call accept on the consumer with the individual row key instances in this RowSequence, in increasing order.
      Specified by:
      forEachRowKey in interface RowSequence
      Parameters:
      lc - a consumer to feed the individual row key values to.
      Returns:
      false if the consumer provided ever returned false, true otherwise.
    • forEachRowKeyRange

      default boolean forEachRowKeyRange(LongRangeAbortableConsumer larc)
      Description copied from interface: RowSequence
      For as long as the consumer wants more ranges, call accept on the consumer with the individual row key ranges in this RowSequence, in increasing order.
      Specified by:
      forEachRowKeyRange in interface RowSequence
      Parameters:
      larc - a consumer to feed the individual row key values to.
      Returns:
      false if the consumer provided ever returned false, true otherwise.
    • getRowSequenceByPosition

      default RowSequence getRowSequenceByPosition(long startPositionInclusive, long length)
      Description copied from interface: RowSequence

      Get an ordered subset of the row keys in this RowSequence for a position range. The result will contain the set of row keys in this that lie at positions in the half-open range [startPositionInclusive, startPositionInclusive + length). The returned reference is owned by the caller, who should call close() when it is done with it.

      Specified by:
      getRowSequenceByPosition in interface RowSequence
      Parameters:
      startPositionInclusive - The position of the first row key to include
      length - The number of row keys to include
      Returns:
      The subset as an RowSequence, which may be this
    • getRowSequenceByKeyRange

      default RowSequence getRowSequenceByKeyRange(long startRowKeyInclusive, long endRowKeyInclusive)
      Description copied from interface: RowSequence

      Get an ordered subset of the row keys in this RowSequence for a row key range. The returned set will be the intersection of the row keys in this with the row keys in the closed interval [startRowKeyInclusive, endRowKeyInclusive]. The returned reference is owned by the caller, who should call close() when it is done with it.

      Specified by:
      getRowSequenceByKeyRange in interface RowSequence
      Parameters:
      startRowKeyInclusive - The minimum row key to include
      endRowKeyInclusive - The maximum row key to include
      Returns:
      The subset as an RowSequence, which may be this
    • getRowSequenceIterator

      default RowSequence.Iterator getRowSequenceIterator()
      Description copied from interface: RowSequence
      Get an RowSequence.Iterator over this RowSequence.
      Specified by:
      getRowSequenceIterator in interface RowSequence
      Returns:
      A new iterator, positioned at the first row key
    • rangesCountUpperBound

      default long rangesCountUpperBound()
    • getAverageRunLengthEstimate

      default long getAverageRunLengthEstimate()
      Description copied from interface: RowSequence

      Get an estimate of the average (mean) length of runs of adjacent row keys in this RowSequence.

      Implementations should strive to keep this method efficient (O(1) preferred) at the expense of accuracy.

      Empty RowSequence should return an arbitrary valid value, usually 1.

      Specified by:
      getAverageRunLengthEstimate in interface RowSequence
      Returns:
      An estimate of the average run length in this RowSequence, in [1, size()]
    • isContiguous

      default boolean isContiguous()
      Description copied from interface: RowSequence
      Helper to tell you if this is one contiguous range.
      Specified by:
      isContiguous in interface RowSequence
    • size

      long size()
      Description copied from interface: RowSequence
      Get the number of row keys in this RowSequence.
      Specified by:
      size in interface LongSizedDataStructure
      Specified by:
      size in interface RowSequence
      Returns:
      The size, in [0, Long.MAX_VALUE]
    • rangeStart

      long rangeStart()
    • rangeEnd

      long rangeEnd()