Package com.illumon.iris.db.v2.ssms
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.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SegmentedSortedMultiSet.RemoveContext
-
Field Summary
Fields Modifier and Type Field Description static boolean
SEGMENTED_SORTED_MULTISET_VALIDATION
-
Method Summary
Modifier and Type Method Description void
clearDeltas()
default LongChunk<?>
countChunk()
default void
fillKeyChunk(WritableChunk<?> keyChunk, int offset)
int
getAddedSize()
T
getMax()
long
getMaxCount()
T
getMin()
long
getMinCount()
int
getNodeSize()
int
getRemovedSize()
boolean
insert(WritableChunk<? extends Attributes.Values> valuesToInsert, WritableIntChunk<Attributes.ChunkLengths> counts)
Insert new valuesToInsert into this SSMS.default Chunk<?>
keyChunk()
static SegmentedSortedMultiSet
make(ChunkType chunkType, int nodeSize, Class<?> objectType)
static Supplier<SegmentedSortedMultiSet>
makeFactory(ChunkType chunkType, int nodeSize, Class<?> objectType)
static SegmentedSortedMultiSet.RemoveContext
makeRemoveContext(int nodeSize)
static Supplier<SegmentedSortedMultiSet.RemoveContext>
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 Attributes.Values> valuesToRemove, WritableIntChunk<Attributes.ChunkLengths> lengths)
Remove valuesToRemove from this SSMS.void
setTrackDeltas(boolean shouldTrackDeltas)
long
size()
The size of this data structure.long
totalSize()
-
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 Attributes.Values> valuesToInsert, WritableIntChunk<Attributes.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 Attributes.Values> valuesToRemove, WritableIntChunk<Attributes.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()
-