Package com.illumon.iris.db.v2.ssms
Class CharSegmentedSortedMultiset
java.lang.Object
com.illumon.iris.db.v2.ssms.CharSegmentedSortedMultiset
- All Implemented Interfaces:
DbArrayBase,DbCharArray,LongSizedDataStructure,SegmentedSortedMultiSet<Character>,ToStringWithElements,Serializable
public final class CharSegmentedSortedMultiset
extends Object
implements SegmentedSortedMultiSet<Character>, DbCharArray
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.tables.dbarrays.DbCharArray
DbCharArray.IndirectNested classes/interfaces inherited from interface com.illumon.iris.db.v2.ssms.SegmentedSortedMultiSet
SegmentedSortedMultiSet.RemoveContext -
Field Summary
Fields inherited from interface com.illumon.iris.db.tables.dbarrays.DbArrayBase
NULL_ELEMENT_STRINGFields inherited from interface com.illumon.iris.db.tables.dbarrays.DbCharArray
serialVersionUIDFields inherited from interface com.illumon.iris.db.v2.ssms.SegmentedSortedMultiSet
SEGMENTED_SORTED_MULTISET_VALIDATIONFields inherited from interface com.illumon.util.format.ToStringWithElements
ARRAY_SIZE_WARNING, DEFAULT_ARRAY_SIZE_COPY, MAX_ARRAY_SIZE_COPY -
Constructor Summary
ConstructorsConstructorDescriptionCharSegmentedSortedMultiset(int leafSize) Create a CharSegmentedSortedArray with the given leafSize. -
Method Summary
Modifier and TypeMethodDescriptionvoidLongChunk<?>booleanvoidfillAddedChunk(WritableCharChunk<? extends Attributes.Values> chunk, int position) voidfillKeyChunk(WritableChunk<?> keyChunk, int offset) voidfillRemovedChunk(WritableCharChunk<? extends Attributes.Values> chunk, int position) charget(long i) intReturn a version of this DbArrayBase that is flattened out to only reference memory.getMax()charlonggetMin()charlongintchargetPrev(long i) intinthashCode()booleaninsert(WritableChunk<? extends Attributes.Values> valuesToInsert, WritableIntChunk<Attributes.ChunkLengths> counts) Insert new valuesToInsert into this SSMS.CharChunk<?>keyChunk()voidmoveBackToFront(SegmentedSortedMultiSet untypedDestination, long count) Remove count elements from the back of this SSM and add them to the front of the destination SSM.voidmoveFrontToBack(SegmentedSortedMultiSet untypedDestination, long count) Remove count elements from the front of this SSM and add them to the back of the destination SSM.booleanremove(SegmentedSortedMultiSet.RemoveContext removeContext, WritableChunk<? extends Attributes.Values> valuesToRemove, WritableIntChunk<Attributes.ChunkLengths> counts) Remove valuesToRemove from this SSA.voidsetTrackDeltas(boolean shouldTrackDeltas) longsize()The size of this data structure.subArray(long fromIndex, long toIndex) subArrayByPositions(long[] positions) char[]toArray()toString()longvoidvalidate()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.tables.dbarrays.DbArrayBase
isEmptyMethods inherited from interface com.illumon.iris.db.tables.dbarrays.DbCharArray
fillChunk, getComponentType, toChunkMethods inherited from interface com.illumon.iris.db.util.LongSizedDataStructure
intSize, intSizeMethods inherited from interface com.illumon.util.format.ToStringWithElements
toString
-
Constructor Details
-
CharSegmentedSortedMultiset
public CharSegmentedSortedMultiset(int leafSize) Create a CharSegmentedSortedArray with the given leafSize.- Parameters:
leafSize- the maximumSize for any leaf
-
-
Method Details
-
insert
public boolean insert(WritableChunk<? extends Attributes.Values> valuesToInsert, WritableIntChunk<Attributes.ChunkLengths> counts) Description copied from interface:SegmentedSortedMultiSetInsert 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.- Specified by:
insertin interfaceSegmentedSortedMultiSet<Character>- Parameters:
valuesToInsert- the valuesToInsert to insertcounts- the number of times each value occurs- Returns:
- true if any new values were inserted
-
remove
public boolean remove(SegmentedSortedMultiSet.RemoveContext removeContext, WritableChunk<? extends Attributes.Values> valuesToRemove, WritableIntChunk<Attributes.ChunkLengths> counts) Remove valuesToRemove from this SSA. The valuesToRemove to remove must be sorted.- Specified by:
removein interfaceSegmentedSortedMultiSet<Character>- Parameters:
valuesToRemove- the valuesToRemove to removeremoveContext- removalContext- Returns:
- true if any values were removed.
-
validate
-
totalSize
public long totalSize()- Specified by:
totalSizein interfaceSegmentedSortedMultiSet<Character>- Returns:
- the total size of the set in elements (i.e. if A exists twice, 2 is returned not one)
-
getNodeSize
public int getNodeSize()- Specified by:
getNodeSizein interfaceSegmentedSortedMultiSet<Character>
-
getMin
- Specified by:
getMinin interfaceSegmentedSortedMultiSet<Character>
-
getMax
- Specified by:
getMaxin interfaceSegmentedSortedMultiSet<Character>
-
getMinChar
public char getMinChar() -
getMinCount
public long getMinCount()- Specified by:
getMinCountin interfaceSegmentedSortedMultiSet<Character>- Returns:
- the number of times the minimum value exists in this SSM.
-
getMaxChar
public char getMaxChar() -
getMaxCount
public long getMaxCount()- Specified by:
getMaxCountin interfaceSegmentedSortedMultiSet<Character>- Returns:
- the number of times the maximum value exists in this SSM.
-
moveFrontToBack
Description copied from interface:SegmentedSortedMultiSetRemove 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.
- Specified by:
moveFrontToBackin interfaceSegmentedSortedMultiSet<Character>- Parameters:
untypedDestination- the SegmentedSortedMultiSet to append count elements tocount- how many elements to move to the destination
-
moveBackToFront
Description copied from interface:SegmentedSortedMultiSetRemove 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.
- Specified by:
moveBackToFrontin interfaceSegmentedSortedMultiSet<Character>- Parameters:
untypedDestination- the SegmentedSortedMultiSet to prepend count elements tocount- how many elements to move to the destination
-
keyChunk
- Specified by:
keyChunkin interfaceSegmentedSortedMultiSet<Character>
-
fillKeyChunk
- Specified by:
fillKeyChunkin interfaceSegmentedSortedMultiSet<Character>
-
countChunk
- Specified by:
countChunkin interfaceSegmentedSortedMultiSet<Character>
-
setTrackDeltas
public void setTrackDeltas(boolean shouldTrackDeltas) - Specified by:
setTrackDeltasin interfaceSegmentedSortedMultiSet<Character>
-
clearDeltas
public void clearDeltas()- Specified by:
clearDeltasin interfaceSegmentedSortedMultiSet<Character>
-
getAddedSize
public int getAddedSize()- Specified by:
getAddedSizein interfaceSegmentedSortedMultiSet<Character>
-
getRemovedSize
public int getRemovedSize()- Specified by:
getRemovedSizein interfaceSegmentedSortedMultiSet<Character>
-
fillRemovedChunk
-
fillAddedChunk
-
getPrevValues
-
get
public char get(long i) - Specified by:
getin interfaceDbCharArray
-
subArray
- Specified by:
subArrayin interfaceDbArrayBase- Specified by:
subArrayin interfaceDbCharArray
-
subArrayByPositions
- Specified by:
subArrayByPositionsin interfaceDbArrayBase- Specified by:
subArrayByPositionsin interfaceDbCharArray
-
toArray
public char[] toArray()- Specified by:
toArrayin interfaceDbArrayBase- Specified by:
toArrayin interfaceDbCharArray
-
size
public long size()Description copied from interface:LongSizedDataStructureThe size of this data structure.- Specified by:
sizein interfaceDbCharArray- Specified by:
sizein interfaceLongSizedDataStructure- Specified by:
sizein interfaceSegmentedSortedMultiSet<Character>- Returns:
- the size of the set (i.e. the number of unique elements).
-
toDbArray
- Specified by:
toDbArrayin interfaceDbArrayBase- Specified by:
toDbArrayin interfaceDbCharArray
-
getPrev
public char getPrev(long i) - Specified by:
getPrevin interfaceDbCharArray
-
getDirect
Description copied from interface:DbCharArrayReturn a version of this DbArrayBase that is flattened out to only reference memory.- Specified by:
getDirectin interfaceDbArrayBase- Specified by:
getDirectin interfaceDbCharArray
-
equals
-
hashCode
public int hashCode() -
toString
-