Interface SegmentedSortedArray

All Superinterfaces:
LongSizedDataStructure
All Known Implementing Classes:
ByteReverseSegmentedSortedArray, ByteSegmentedSortedArray, CharReverseSegmentedSortedArray, CharSegmentedSortedArray, DoubleReverseSegmentedSortedArray, DoubleSegmentedSortedArray, FloatReverseSegmentedSortedArray, FloatSegmentedSortedArray, IntReverseSegmentedSortedArray, IntSegmentedSortedArray, LongReverseSegmentedSortedArray, LongSegmentedSortedArray, NullAwareCharReverseSegmentedSortedArray, NullAwareCharSegmentedSortedArray, ObjectReverseSegmentedSortedArray, ObjectSegmentedSortedArray, ShortReverseSegmentedSortedArray, ShortSegmentedSortedArray

public interface SegmentedSortedArray extends LongSizedDataStructure
  • Field Details

    • SEGMENTED_SORTED_ARRAY_VALIDATION

      static final boolean SEGMENTED_SORTED_ARRAY_VALIDATION
  • Method Details

    • make

      static SegmentedSortedArray make(ChunkType chunkType, boolean reverse, int nodeSize)
    • makeFactory

      static Supplier<SegmentedSortedArray> makeFactory(ChunkType chunkType, boolean reverse, int nodeSize)
    • insert

      void insert(Chunk<? extends Attributes.Any> valuesToInsert, LongChunk<? extends Attributes.KeyIndices> indicesToInsert)
      Insert new valuesToInsert into this SSA. The valuesToInsert to insert must be sorted.
      Parameters:
      valuesToInsert - the valuesToInsert to insert
      indicesToInsert - the corresponding indicesToInsert
    • remove

      void remove(Chunk<? extends Attributes.Any> valuesToRemove, LongChunk<? extends Attributes.KeyIndices> indicesToRemove)
      Remove valuesToRemove from this SSA. The valuesToRemove to remove must be sorted.
      Parameters:
      valuesToRemove - the valuesToRemove to remove
      indicesToRemove - the corresponding indices
    • removeAndGetPrior

      void removeAndGetPrior(Chunk<? extends Attributes.Any> stampChunk, LongChunk<? extends Attributes.KeyIndices> indicesToRemove, WritableLongChunk<? extends Attributes.KeyIndices> priorRedirections)
      Remove the values and indices referenced in stampChunk and indicesToRemove. Fill priorRedirections with the redirection value immediately preceding the removed value.
      Parameters:
      stampChunk - the values to remove
      indicesToRemove - the indices (parallel to the values)
      priorRedirections - the output prior redirections (parallel to valeus/indices)
    • insertAndGetNextValue

      <T extends Attributes.Any> int insertAndGetNextValue(Chunk<T> valuesToInsert, LongChunk<? extends Attributes.KeyIndices> indicesToInsert, WritableChunk<T> nextValue)
    • applyShift

      void applyShift(Chunk<? extends Attributes.Any> stampChunk, LongChunk<? extends Attributes.KeyIndices> keyChunk, long shiftDelta)
    • applyShiftReverse

      void applyShiftReverse(Chunk<? extends Attributes.Any> stampChunk, LongChunk<? extends Attributes.KeyIndices> keyChunk, long shiftDelta)
    • getNodeSize

      int getNodeSize()
    • forAllKeys

      void forAllKeys(LongConsumer longConsumer)
      Call the longConsumer for each of the long index keys in this SegmentedSortedArray.
      Parameters:
      longConsumer - the long consumer to call
    • makeChecker

      SsaChecker makeChecker()
    • isReversed

      boolean isReversed()
    • getFirst

      long getFirst()
      Returns:
      the first index in this SSA, Index.NULL_KEY when empty.
    • getLast

      long getLast()
      Returns:
      the last index in this SSA, Index.NULL_KEY when empty.