Interface SegmentedSortedMultiSet<T>
- Type Parameters:
T
-
- All Superinterfaces:
LongSizedDataStructure
- All Known Implementing Classes:
ByteSegmentedSortedMultiset
,CharSegmentedSortedMultiset
,DoubleSegmentedSortedMultiset
,FloatSegmentedSortedMultiset
,IntSegmentedSortedMultiset
,LongSegmentedSortedMultiset
,ObjectSegmentedSortedMultiset
,ShortSegmentedSortedMultiset
MultiSet of primitive or object values stored as parallel arrays of counts and values. Nulls disallowed.
-
Nested Class Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
@NotNull WritableLongChunk<?>
default void
fillKeyChunk
(WritableChunk<?> keyChunk, int offset) int
getMax()
long
getMin()
long
int
int
boolean
insert
(WritableChunk<? extends Values> valuesToInsert, WritableIntChunk<ChunkLengths> counts) Insert new valuesToInsert into this SSMS.@NotNull WritableChunk<?>
keyChunk()
static SegmentedSortedMultiSet
static Supplier<SegmentedSortedMultiSet>
makeFactory
(ChunkType chunkType, int nodeSize, Class<?> objectType) makeRemoveContext
(int nodeSize) makeRemoveContextFactory
(int nodeSize) 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.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.boolean
remove
(SegmentedSortedMultiSet.RemoveContext removeContext, WritableChunk<? extends Values> valuesToRemove, WritableIntChunk<ChunkLengths> lengths) Remove valuesToRemove from this SSMS.void
setTrackDeltas
(boolean shouldTrackDeltas) long
size()
The size of this data structure.long
Methods inherited from interface io.deephaven.util.datastructures.LongSizedDataStructure
intSize, intSize
-
Field Details
-
SEGMENTED_SORTED_MULTISET_VALIDATION
static final boolean SEGMENTED_SORTED_MULTISET_VALIDATION
-
-
Method Details
-
make
-
makeFactory
static Supplier<SegmentedSortedMultiSet> makeFactory(ChunkType chunkType, int nodeSize, Class<?> objectType) -
makeRemoveContextFactory
-
makeRemoveContext
-
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 insertcounts
- 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
- removalContextvaluesToRemove
- the valuesToRemove to remove- Returns:
- true if any values were removed.
-
keyChunk
-
fillKeyChunk
-
countChunk
-
getNodeSize
int getNodeSize() -
size
long size()Description copied from interface:LongSizedDataStructure
The size of this data structure.- Specified by:
size
in interfaceLongSizedDataStructure
- 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
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 tocount
- how many elements to move to the destination
-
moveBackToFront
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 tocount
- 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()
-