Interface SegmentedSortedMultiSet<T>

Type Parameters:
T -
All Superinterfaces:
LongSizedDataStructure
All Known Implementing Classes:
ByteSegmentedSortedMultiset, CharSegmentedSortedMultiset, DoubleSegmentedSortedMultiset, FloatSegmentedSortedMultiset, IntSegmentedSortedMultiset, LongSegmentedSortedMultiset, ObjectSegmentedSortedMultiset, ShortSegmentedSortedMultiset

public interface SegmentedSortedMultiSet<T> extends LongSizedDataStructure
MultiSet of primitive or object values stored as parallel arrays of counts and values. Nulls disallowed.
  • Field Details

    • SEGMENTED_SORTED_MULTISET_VALIDATION

      static final boolean SEGMENTED_SORTED_MULTISET_VALIDATION
  • Method Details

    • make

      static SegmentedSortedMultiSet make(ChunkType chunkType, int nodeSize, Class<?> objectType)
    • makeFactory

      static Supplier<SegmentedSortedMultiSet> makeFactory(ChunkType chunkType, int nodeSize, Class<?> objectType)
    • makeRemoveContextFactory

      static Supplier<SegmentedSortedMultiSet.RemoveContext> makeRemoveContextFactory(int nodeSize)
    • makeRemoveContext

      static SegmentedSortedMultiSet.RemoveContext makeRemoveContext(int nodeSize)
    • insert

      boolean insert(WritableChunk<? extends Values> valuesToInsert, WritableIntChunk<ChunkLengths> counts)
      Insert new valuesToInsert into this SSMS. The valuesToInsert to insert must be sorted, without duplicates. The valuesToInsert and counts chunks will be modified during this call, and the resulting chunks are undefined.
      Parameters:
      valuesToInsert - the valuesToInsert to insert
      counts - the number of times each value occurs
      Returns:
      true if any new values were inserted
    • remove

      boolean remove(SegmentedSortedMultiSet.RemoveContext removeContext, WritableChunk<? extends Values> valuesToRemove, WritableIntChunk<ChunkLengths> lengths)
      Remove valuesToRemove from this SSMS. The valuesToRemove to remove must be sorted.
      Parameters:
      removeContext - removalContext
      valuesToRemove - the valuesToRemove to remove
      Returns:
      true if any values were removed.
    • keyChunk

      @NotNull @VisibleForTesting @NotNull WritableChunk<?> keyChunk()
    • fillKeyChunk

      default void fillKeyChunk(WritableChunk<?> keyChunk, int offset)
    • countChunk

      @NotNull @VisibleForTesting @NotNull WritableLongChunk<?> countChunk()
    • getNodeSize

      int getNodeSize()
    • size

      long size()
      Description copied from interface: LongSizedDataStructure
      The size of this data structure.
      Specified by:
      size in interface LongSizedDataStructure
      Returns:
      the size of the set (i.e. the number of unique elements).
    • totalSize

      long totalSize()
      Returns:
      the total size of the set in elements (i.e. if A exists twice, 2 is returned not one)
    • moveFrontToBack

      void moveFrontToBack(SegmentedSortedMultiSet destination, long count)
      Remove count elements from the front of this SSM and add them to the back of the destination SSM.

      The minimum element of this SSM must be greater than or equal to the maximum of destination.

      Parameters:
      destination - the SegmentedSortedMultiSet to append count elements to
      count - how many elements to move to the destination
    • moveBackToFront

      void moveBackToFront(SegmentedSortedMultiSet destination, long count)
      Remove count elements from the back of this SSM and add them to the front of the destination SSM.

      The minimum element of this SSM must be less than or equal to the maximum of destination.

      Parameters:
      destination - the SegmentedSortedMultiSet to prepend count elements to
      count - how many elements to move to the destination
    • getMinCount

      long getMinCount()
      Returns:
      the number of times the minimum value exists in this SSM.
    • getMaxCount

      long getMaxCount()
      Returns:
      the number of times the maximum value exists in this SSM.
    • getMin

      T getMin()
    • getMax

      T getMax()
    • setTrackDeltas

      void setTrackDeltas(boolean shouldTrackDeltas)
    • clearDeltas

      void clearDeltas()
    • getAddedSize

      int getAddedSize()
    • getRemovedSize

      int getRemovedSize()