Class SubListProcessor<E>
- All Implemented Interfaces:
- Iterable<E>,- CapacityCarrying,- ConsolidatableCollection,- ExtendedBag<E>,- ExtendedCollection<E>,- ExtendedList<E>,- ExtendedSequence<E>,- OptimizableCollection,- ReleasingCollection<E>,- Sized,- Truncateable,- Sortable<E>,- XDecreasingList<E>,- XDecreasingSequence<E>,- XGettingBag<E>,- XGettingCollection<E>,- XGettingList<E>,- XGettingSequence<E>,- XIndexIterable<E>,- XIterable<E>,- XJoinable<E>,- XOrderingSequence<E>,- XProcessingBag<E>,- XProcessingCollection<E>,- XProcessingList<E>,- XProcessingSequence<E>,- XRemovingBag<E>,- XRemovingCollection<E>,- XRemovingList<E>,- XRemovingSequence<E>,- XReplacingBag<E>,- XReplacingCollection<E>,- XSettingList<E>,- XSettingSequence<E>,- XSortableSequence<E>,- Processable<E>,- Clearable,- Copyable
public class SubListProcessor<E> extends SubListView<E> implements XDecreasingList<E>
- 
Nested Class SummaryNested classes/interfaces inherited from interface one.microstream.collections.interfaces.ExtendedCollectionExtendedCollection.Creator<E,C extends ExtendedCollection<E>>Nested classes/interfaces inherited from interface one.microstream.collections.types.XDecreasingListXDecreasingList.Creator<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingCollectionXGettingCollection.Creator<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingListXGettingList.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingSequenceXGettingSequence.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XIterableXIterable.Executor<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XProcessingListXProcessingList.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XProcessingSequenceXProcessingSequence.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.types.XReplacingBagXReplacingBag.Factory<E>
- 
Constructor SummaryConstructors Constructor Description SubListProcessor(XProcessingList<E> list, long fromIndex, long toIndex)
- 
Method SummaryModifier and Type Method Description voidclear()Clears all elements from the collection while leaving the capacity as it is.longconsolidate()Consolidates the internal storage of this collection by discarding all elements of the internal storage that have become obsolete or otherwise unneeded anymore.SubListProcessor<E>copy()Creates a true copy of this list which references the same elements in the same order as this list does at the time the method is called.Efetch()Remove and retrieve first or throw IndexOutOfBoundsException if empty (fetch ~= first).XDecreasingList<E>fill(long offset, long length, E element)Fills all slots from the offset to the offset+length with the given element, regardless whether a slot isnullor not.<C extends Consumer<? super E>>
 CmoveSelection(C target, long... indices)<C extends Consumer<? super E>>
 CmoveTo(C target, Predicate<? super E> predicate)longnullRemove()one.microstream.collections.SubListProcessor.OldSubListProcessor<E>old()longoptimize()Optimizes internal memory usage by rebuilding the storage to only occupy as much memory as needed to store the currently contained elements in terms of the collection's current memory usage configuration (e.g.Epick()Remove and retrieve last or null if empty (like easy extraction from collection's end).Epinch()Remove and retrieve first or null if empty (like forceful extraction from collection's base)Epop()Remove and retrieve last or throw IndexOutOfBoundsException if empty (stack conceptional pop).<P extends Consumer<? super E>>
 Pprocess(P procedure)SubListProcessor<E>range(long fromIndex, long toIndex)longremove(E element)longremoveAll(XGettingCollection<? extends E> samples)EremoveAt(long index)Remove and retrieve element at index or throw IndexOutOfBoundsException if invalid.longremoveBy(Predicate<? super E> predicate)longremoveDuplicates()longremoveDuplicates(Equalator<? super E> equalator)booleanremoveOne(E element)SubListProcessor<E>removeRange(long startIndex, long length)longremoveSelection(long[] indices)longreplace(E element, E replacement)longreplace(Predicate<? super E> predicate, E substitute)longreplaceAll(XGettingCollection<? extends E> elements, E replacement)booleanreplaceOne(E element, E replacement)Replaces the first element that is equal to the given element with the replacement and then returns true.booleanreplaceOne(Predicate<? super E> predicate, E substitute)longretainAll(XGettingCollection<? extends E> samples)Removing all elements except the ones contained in the given elements-collection.SubListProcessor<E>retainRange(long startIndex, long length)Removing all elements but the ones from the offset (basically start index) to the offset+length (end index).Eretrieve(E element)Remove and retrieve first occurrence.EretrieveBy(Predicate<? super E> predicate)Remove and retrieve first item that match the predicate.XDecreasingList<E>reverse()Reverses the order of its own elements and returns itself.booleanset(long index, E element)XDecreasingList<E>set(long index, E[] elements, int offset, int length)XDecreasingList<E>set(long index, XGettingSequence<? extends E> elements, long offset, long length)XDecreasingList<E>setAll(long index, E... elements)voidsetFirst(E element)EsetGet(long index, E element)voidsetLast(E element)XSortableSequence<E>shiftBy(long sourceIndex, long distance)Moves the element from the sourceIndex in the sequence to a higher index position.
 All other elements are possibly moved to create the empty slot for the shifting element.XSortableSequence<E>shiftBy(long sourceIndex, long distance, long length)Moves multiple elements from the sourceIndex in the sequence to a higher index position.
 All other elements are possibly moved to create the empty slot for the shifting elements.XSortableSequence<E>shiftTo(long sourceIndex, long targetIndex)Moves the element from the sourceIndex in the sequence to the targetIndex.
 All other elements are possibly moved to create the empty slot for the shifting element.XSortableSequence<E>shiftTo(long sourceIndex, long targetIndex, long length)Moves multiple elements from the sourceIndex in the sequence to the targetIndex.
 All other elements are possibly moved to create the empty slot for the shifting element.XDecreasingList<E>sort(Comparator<? super E> comparator)Sorts this collection according to the given comparator and returns itself.longsubstitute(Function<? super E,? extends E> mapper)longsubstitute(Predicate<? super E> predicate, Function<E,E> mapper)XDecreasingList<E>swap(long indexA, long indexB)XDecreasingList<E>swap(long indexA, long indexB, long length)SubListProcessor<E>toReversed()Creates a newXGettingSequencewith the reversed order of elements.voidtruncate()Clears (and reinitializes if needed) this collection in the fastest possible way, i.e.SubListView<E>view(long fromIndex, long toIndex)Creates a sub-view of this collection and returns it.Methods inherited from class one.microstream.collections.SubListViewapplies, at, contains, containsAll, containsId, containsSearched, copySelection, copyTo, count, countBy, distinct, distinct, equality, equals, equalsContent, except, filterTo, first, get, getEndIndex, hasVolatileElements, immure, indexBy, indexOf, intersect, isEmpty, isFull, isSorted, iterate, iterateIndexed, iterator, join, last, lastIndexBy, lastIndexOf, listIterator, listIterator, max, maximumCapacity, maxIndex, min, minIndex, nullAllowed, nullContained, peek, poll, remainingCapacity, scan, search, seek, shiftIndices, size, toArray, toArray, union, viewMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.microstream.collections.interfaces.CapacityCarryingisFull, maximumCapacity, remainingCapacityMethods inherited from interface one.microstream.collections.interfaces.ExtendedCollectionnullAllowedMethods inherited from interface one.microstream.collections.types.XGettingCollectionapplies, contains, containsAll, containsId, containsSearched, copyTo, count, countBy, distinct, distinct, equality, equals, equals, equalsContent, except, filterTo, hashCode, hasVolatileElements, intersect, intSize, iterator, join, max, min, nullContained, search, seek, size, toArray, toArray, unionMethods inherited from interface one.microstream.collections.types.XGettingListimmure, listIterator, listIterator, viewMethods inherited from interface one.microstream.collections.types.XGettingSequenceat, copySelection, first, get, hasIndex, indexBy, indexOf, isSorted, last, lastIndexBy, lastIndexOf, maxIndex, minIndex, peek, poll, scan
- 
Constructor Details
- 
Method Details- 
clearpublic final void clear()Description copied from interface:XRemovingCollectionClears all elements from the collection while leaving the capacity as it is.- Specified by:
- clearin interface- Clearable
- Specified by:
- clearin interface- XRemovingCollection<E>
 
- 
process- Specified by:
- processin interface- Processable<E>
 
- 
removeDuplicates- Specified by:
- removeDuplicatesin interface- XProcessingCollection<E>
 
- 
remove- Specified by:
- removein interface- XRemovingCollection<E>
 
- 
removeAll- Specified by:
- removeAllin interface- XRemovingCollection<E>
 
- 
removeDuplicatespublic final long removeDuplicates()- Specified by:
- removeDuplicatesin interface- XRemovingCollection<E>
 
- 
retrieveDescription copied from interface:XProcessingCollectionRemove and retrieve first occurrence.- Specified by:
- retrievein interface- XProcessingCollection<E>
- Parameters:
- element- The element to retrieve
- Returns:
- The item.
 
- 
retrieveByDescription copied from interface:XProcessingCollectionRemove and retrieve first item that match the predicate.- Specified by:
- retrieveByin interface- XProcessingCollection<E>
- Parameters:
- predicate- The Predicate for the search.
- Returns:
- The item matched (and is also removed)
 
- 
removeOne- Specified by:
- removeOnein interface- XRemovingCollection<E>
 
- 
retainAllDescription copied from interface:XRemovingCollectionRemoving all elements except the ones contained in the given elements-collection.Basically intersect this collection with the given collection and only keeping the resulting elements. - Specified by:
- retainAllin interface- XRemovingCollection<E>
- Parameters:
- samples- to retain
- Returns:
- Amount of deleted elements
 
- 
removeBy- Specified by:
- removeByin interface- XProcessingCollection<E>
 
- 
truncatepublic final void truncate()Description copied from interface:XRemovingCollectionClears (and reinitializes if needed) this collection in the fastest possible way, i.e. by allocating a new and empty internal storage of default capacity. The collection will be empty after calling this method.- Specified by:
- truncatein interface- Truncateable
- Specified by:
- truncatein interface- XRemovingCollection<E>
 
- 
range- Specified by:
- rangein interface- XDecreasingList<E>
- Specified by:
- rangein interface- XDecreasingSequence<E>
- Specified by:
- rangein interface- XGettingList<E>
- Specified by:
- rangein interface- XGettingSequence<E>
- Specified by:
- rangein interface- XSettingList<E>
- Specified by:
- rangein interface- XSettingSequence<E>
- Overrides:
- rangein class- SubListView<E>
 
- 
consolidatepublic final long consolidate()Description copied from interface:ConsolidatableCollectionConsolidates the internal storage of this collection by discarding all elements of the internal storage that have become obsolete or otherwise unneeded anymore. (e.g.WeakReferenceentries whose reference has been cleared). If this is not possible or not needed in the concrete implementation, this method does nothing and returns 0.- Specified by:
- consolidatein interface- ConsolidatableCollection
- Specified by:
- consolidatein interface- XRemovingCollection<E>
- Returns:
- the number of discarded entries.
 
- 
moveTo- Specified by:
- moveToin interface- XProcessingCollection<E>
 
- 
optimizepublic final long optimize()Description copied from interface:XRemovingCollectionOptimizes internal memory usage by rebuilding the storage to only occupy as much memory as needed to store the currently contained elements in terms of the collection's current memory usage configuration (e.g. hash density).If this is not possible or not needed in the concrete implementation, this method does nothing. Note that this method can consume a considerable amount of time depending on the implementation and should only be called intentionally and accurately when reducing occupied memory is needed. - Specified by:
- optimizein interface- OptimizableCollection
- Specified by:
- optimizein interface- XRemovingCollection<E>
- Returns:
- the amount of elements that can be added before the internal storage has to be adjusted.
 
- 
moveSelection- Specified by:
- moveSelectionin interface- XProcessingSequence<E>
 
- 
removeAtDescription copied from interface:XProcessingSequenceRemove and retrieve element at index or throw IndexOutOfBoundsException if invalid.- Specified by:
- removeAtin interface- XProcessingSequence<E>
- Parameters:
- index- index of item to be retrieved.
- Returns:
- Item at index or IndexOutOfBoundsException if invalid.
- Throws:
- UnsupportedOperationException
 
- 
fetchDescription copied from interface:XProcessingCollectionRemove and retrieve first or throw IndexOutOfBoundsException if empty (fetch ~= first).- Specified by:
- fetchin interface- XProcessingCollection<E>
- Returns:
- First item
 
- 
popDescription copied from interface:XProcessingSequenceRemove and retrieve last or throw IndexOutOfBoundsException if empty (stack conceptional pop).- Specified by:
- popin interface- XProcessingSequence<E>
- Returns:
- Last item or IndexOutOfBoundsException if empty.
 
- 
pinchDescription copied from interface:XProcessingCollectionRemove and retrieve first or null if empty (like forceful extraction from collection's base)- Specified by:
- pinchin interface- XProcessingCollection<E>
- Returns:
- First item or null when empty
 
- 
pickDescription copied from interface:XProcessingSequenceRemove and retrieve last or null if empty (like easy extraction from collection's end).- Specified by:
- pickin interface- XProcessingSequence<E>
- Returns:
- Last item or null if empty.
 
- 
removeRange- Specified by:
- removeRangein interface- XRemovingSequence<E>
 
- 
retainRangeDescription copied from interface:XRemovingSequenceRemoving all elements but the ones from the offset (basically start index) to the offset+length (end index).- Specified by:
- retainRangein interface- XRemovingSequence<E>
- Parameters:
- startIndex- is the index of the first element to retain
- length- is the amount of elements to retain
- Returns:
- this
 
- 
removeSelectionpublic final long removeSelection(long[] indices)- Specified by:
- removeSelectionin interface- XRemovingSequence<E>
 
- 
toReversedDescription copied from interface:XGettingSequenceCreates a newXGettingSequencewith the reversed order of elements.This method creates a new collection and does not change the existing collection. - Specified by:
- toReversedin interface- XDecreasingList<E>
- Specified by:
- toReversedin interface- XDecreasingSequence<E>
- Specified by:
- toReversedin interface- XGettingList<E>
- Specified by:
- toReversedin interface- XGettingSequence<E>
- Specified by:
- toReversedin interface- XProcessingList<E>
- Specified by:
- toReversedin interface- XProcessingSequence<E>
- Specified by:
- toReversedin interface- XSettingList<E>
- Specified by:
- toReversedin interface- XSettingSequence<E>
- Specified by:
- toReversedin interface- XSortableSequence<E>
- Overrides:
- toReversedin class- SubListView<E>
- Returns:
- New copy of the collection
 
- 
copyDescription copied from interface:XGettingSequenceCreates a true copy of this list which references the same elements in the same order as this list does at the time the method is called. The elements themselves are NOT copied (no deep copying).
 The type of the returned list is the same as of this list if possible (i.e.: a SubList can not meaningful return a true copy that references its elements but still is a SubList)- Specified by:
- copyin interface- Copyable
- Specified by:
- copyin interface- XDecreasingList<E>
- Specified by:
- copyin interface- XDecreasingSequence<E>
- Specified by:
- copyin interface- XGettingBag<E>
- Specified by:
- copyin interface- XGettingCollection<E>
- Specified by:
- copyin interface- XGettingList<E>
- Specified by:
- copyin interface- XGettingSequence<E>
- Specified by:
- copyin interface- XProcessingBag<E>
- Specified by:
- copyin interface- XProcessingList<E>
- Specified by:
- copyin interface- XReplacingBag<E>
- Specified by:
- copyin interface- XSettingList<E>
- Specified by:
- copyin interface- XSettingSequence<E>
- Specified by:
- copyin interface- XSortableSequence<E>
- Overrides:
- copyin class- SubListView<E>
- Returns:
- a copy of this list
 
- 
nullRemovepublic final long nullRemove()- Specified by:
- nullRemovein interface- XRemovingCollection<E>
 
- 
viewDescription copied from interface:XGettingSequenceCreates a sub-view of this collection and returns it. It is a read-only collection, which wraps around this collection and only allows read methods.
 The view is limited to a range from the lowIndex to the highIndex.A view is different from immutable collection ( XGettingCollection.immure()) in the way, that changes in this collection are still affecting the view. The immutable collection on the other hand has no reference to this collection and changes therefore do not affect the immutable collection.- Specified by:
- viewin interface- XGettingList<E>
- Specified by:
- viewin interface- XGettingSequence<E>
- Specified by:
- viewin interface- XProcessingSequence<E>
- Overrides:
- viewin class- SubListView<E>
- Parameters:
- fromIndex- defines lower boundary for the view of the collection.
- toIndex- defines higher boundary for the view of the collection.
- Returns:
- new read-only collection to view a range of elements in this collection
 
- 
old- Specified by:
- oldin interface- XGettingCollection<E>
- Specified by:
- oldin interface- XGettingList<E>
- Overrides:
- oldin class- SubListView<E>
 
- 
replaceOneDescription copied from interface:XReplacingBagReplaces the first element that is equal to the given element with the replacement and then returns true.- Specified by:
- replaceOnein interface- XReplacingBag<E>
- Parameters:
- element- to replace
- replacement- for the found element
- Returns:
- trueif element is found,- falseif not
 
- 
replace- Specified by:
- replacein interface- XReplacingBag<E>
 
- 
replaceAll- Specified by:
- replaceAllin interface- XReplacingBag<E>
 
- 
replaceOne- Specified by:
- replaceOnein interface- XReplacingBag<E>
 
- 
replace- Specified by:
- replacein interface- XReplacingBag<E>
 
- 
substitute- Specified by:
- substitutein interface- XReplacingCollection<E>
 
- 
substitute- Specified by:
- substitutein interface- XReplacingBag<E>
 
- 
setpublic final boolean set(long index, E element) throws IndexOutOfBoundsException, ArrayIndexOutOfBoundsException- Specified by:
- setin interface- XSettingSequence<E>
- Throws:
- IndexOutOfBoundsException
- ArrayIndexOutOfBoundsException
 
- 
setGet- Specified by:
- setGetin interface- XSettingSequence<E>
 
- 
setFirst- Specified by:
- setFirstin interface- XSettingSequence<E>
 
- 
setLast- Specified by:
- setLastin interface- XSettingSequence<E>
 
- 
shiftToDescription copied from interface:XOrderingSequenceMoves the element from the sourceIndex in the sequence to the targetIndex.
 All other elements are possibly moved to create the empty slot for the shifting element.Does not expand or shrink the capacity of the sequence. Throws a IndexExceededExceptionif sourceIndex or targetIndex are greater than the size of the sequence.- Specified by:
- shiftToin interface- XOrderingSequence<E>
- Specified by:
- shiftToin interface- XSortableSequence<E>
- Parameters:
- sourceIndex- points to the source element; Index of the source element
- targetIndex- points to the target element; Index of the target element
- Returns:
- this
 
- 
shiftToDescription copied from interface:XOrderingSequenceMoves multiple elements from the sourceIndex in the sequence to the targetIndex.
 All other elements are possibly moved to create the empty slot for the shifting element.Does not expand or shrink the capacity of the sequence. Throws a IndexExceededExceptionif sourceIndex or targetIndex exceed the size of the sequence.- Specified by:
- shiftToin interface- XOrderingSequence<E>
- Specified by:
- shiftToin interface- XSortableSequence<E>
- Parameters:
- sourceIndex- points to the source element; Index of the source element
- targetIndex- points to the target element; Index of the target element
- length- Amount of moved elements.
- Returns:
- self
 
- 
shiftByDescription copied from interface:XOrderingSequenceMoves the element from the sourceIndex in the sequence to a higher index position.
 All other elements are possibly moved to create the empty slot for the shifting element. ("to the right")Does not expand or shrink the capacity of the sequence. Throws a IndexExceededExceptionif sourceIndex or targetIndex (sourceIndex+distance) exceed the size of the sequence.- Specified by:
- shiftByin interface- XOrderingSequence<E>
- Specified by:
- shiftByin interface- XSortableSequence<E>
- Parameters:
- sourceIndex- points to the source element; Index of the source element
- distance- of how far the element should be moved. Example: 1 moves the element from position 21 to position 22
- Returns:
- self
 
- 
shiftByDescription copied from interface:XOrderingSequenceMoves multiple elements from the sourceIndex in the sequence to a higher index position.
 All other elements are possibly moved to create the empty slot for the shifting elements. ("to the right")Does not expand or shrink the capacity of the sequence. Throws a IndexExceededExceptionif sourceIndex or targetIndex (sourceIndex+distance+length) exceed the size of the sequence.- Specified by:
- shiftByin interface- XOrderingSequence<E>
- Specified by:
- shiftByin interface- XSortableSequence<E>
- Parameters:
- sourceIndex- points to the source element; Index of the source element
- distance- of how far the element should be moved. Example: 1 moves the element from position 21 to position 22
- length- Amount of moved elements.
- Returns:
- self
 
- 
setAll- Specified by:
- setAllin interface- XDecreasingList<E>
- Specified by:
- setAllin interface- XDecreasingSequence<E>
- Specified by:
- setAllin interface- XSettingList<E>
- Specified by:
- setAllin interface- XSettingSequence<E>
 
- 
set- Specified by:
- setin interface- XDecreasingList<E>
- Specified by:
- setin interface- XDecreasingSequence<E>
- Specified by:
- setin interface- XSettingList<E>
- Specified by:
- setin interface- XSettingSequence<E>
 
- 
setpublic final XDecreasingList<E> set(long index, XGettingSequence<? extends E> elements, long offset, long length)- Specified by:
- setin interface- XDecreasingList<E>
- Specified by:
- setin interface- XDecreasingSequence<E>
- Specified by:
- setin interface- XSettingList<E>
- Specified by:
- setin interface- XSettingSequence<E>
 
- 
swap- Specified by:
- swapin interface- XDecreasingList<E>
- Specified by:
- swapin interface- XDecreasingSequence<E>
- Specified by:
- swapin interface- XOrderingSequence<E>
- Specified by:
- swapin interface- XSettingList<E>
- Specified by:
- swapin interface- XSettingSequence<E>
- Specified by:
- swapin interface- XSortableSequence<E>
 
- 
swap- Specified by:
- swapin interface- XDecreasingList<E>
- Specified by:
- swapin interface- XDecreasingSequence<E>
- Specified by:
- swapin interface- XOrderingSequence<E>
- Specified by:
- swapin interface- XSettingList<E>
- Specified by:
- swapin interface- XSettingSequence<E>
- Specified by:
- swapin interface- XSortableSequence<E>
 
- 
reverseDescription copied from interface:XSortableSequenceReverses the order of its own elements and returns itself.Unlike the XSortableSequence.toReversed()method, this method does not create a new collection, but changes the order of its own elements.- Specified by:
- reversein interface- XDecreasingList<E>
- Specified by:
- reversein interface- XDecreasingSequence<E>
- Specified by:
- reversein interface- XOrderingSequence<E>
- Specified by:
- reversein interface- XSettingList<E>
- Specified by:
- reversein interface- XSettingSequence<E>
- Specified by:
- reversein interface- XSortableSequence<E>
- Returns:
- this
 
- 
fillDescription copied from interface:XSettingListFills all slots from the offset to the offset+length with the given element, regardless whether a slot isnullor not.- Specified by:
- fillin interface- XDecreasingList<E>
- Specified by:
- fillin interface- XSettingList<E>
- Parameters:
- offset- from the start of the collection (start index)
- length- of how many slots should be filled
- element- to use for filling of slots
- Returns:
- this
 
- 
sortDescription copied from interface:SortableSorts this collection according to the given comparator and returns itself.- Specified by:
- sortin interface- Sortable<E>
- Specified by:
- sortin interface- XDecreasingList<E>
- Specified by:
- sortin interface- XDecreasingSequence<E>
- Specified by:
- sortin interface- XSettingList<E>
- Specified by:
- sortin interface- XSettingSequence<E>
- Specified by:
- sortin interface- XSortableSequence<E>
- Parameters:
- comparator- to sort this collection
- Returns:
- this
 
 
-