public class SubListProcessor<E> extends SubListView<E> implements XDecreasingList<E>
XDecreasingList.Creator<E>XProcessingList.Factory<E>XIterable.Executor<E>| Constructor and Description |
|---|
SubListProcessor(XProcessingList<E> list,
long fromIndex,
long toIndex) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all elements from the collection while leaving the capacity as it is.
|
long |
consolidate()
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.
|
E |
fetch() |
XDecreasingList<E> |
fill(long offset,
long length,
E element)
Fills all slots from the offset to the offset+length with the given element,
regardless of whether or not a slot is
null. |
<C extends Consumer<? super E>> |
moveSelection(C target,
long... indices) |
<C extends Consumer<? super E>> |
moveTo(C target,
Predicate<? super E> predicate) |
long |
nullRemove() |
one.microstream.collections.SubListProcessor.OldSubListProcessor<E> |
old() |
long |
optimize()
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.
|
E |
pick() |
E |
pinch() |
E |
pop() |
<P extends Consumer<? super E>> |
process(P procedure) |
SubListProcessor<E> |
range(long fromIndex,
long toIndex) |
long |
remove(E element) |
long |
removeAll(XGettingCollection<? extends E> samples) |
E |
removeAt(long index) |
long |
removeBy(Predicate<? super E> predicate) |
long |
removeDuplicates() |
long |
removeDuplicates(Equalator<? super E> equalator) |
boolean |
removeOne(E element) |
SubListProcessor<E> |
removeRange(long startIndex,
long length) |
long |
removeSelection(long[] indices) |
long |
replace(E element,
E replacement) |
long |
replace(Predicate<? super E> predicate,
E substitute) |
long |
replaceAll(XGettingCollection<? extends E> elements,
E replacement) |
boolean |
replaceOne(E element,
E replacement)
Replaces the first element that is equal to the given element
with the replacement and then returns true.
|
boolean |
replaceOne(Predicate<? super E> predicate,
E substitute) |
long |
retainAll(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).
|
E |
retrieve(E element) |
E |
retrieveBy(Predicate<? super E> predicate) |
XDecreasingList<E> |
reverse()
Reverses the order of its own elements and returns itself.
|
boolean |
set(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) |
void |
setFirst(E element) |
E |
setGet(long index,
E element) |
void |
setLast(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.
|
long |
substitute(Function<? super E,? extends E> mapper) |
long |
substitute(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 new
XGettingSequence with the reversed order of elements. |
void |
truncate()
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.
|
applies, 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, viewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitimmure, viewimmure, listIterator, listIterator, viewiteratenullAllowedpublic SubListProcessor(XProcessingList<E> list, long fromIndex, long toIndex)
public final void clear()
XRemovingCollectionclear in interface XRemovingCollection<E>clear in interface Clearablepublic final <P extends Consumer<? super E>> P process(P procedure)
process in interface Processable<E>public final long removeDuplicates(Equalator<? super E> equalator)
removeDuplicates in interface XProcessingCollection<E>public final long remove(E element)
remove in interface XRemovingCollection<E>public final long removeAll(XGettingCollection<? extends E> samples)
removeAll in interface XRemovingCollection<E>public final long removeDuplicates()
removeDuplicates in interface XRemovingCollection<E>public final E retrieve(E element)
retrieve in interface XProcessingCollection<E>public final E retrieveBy(Predicate<? super E> predicate)
retrieveBy in interface XProcessingCollection<E>public final boolean removeOne(E element)
removeOne in interface XRemovingCollection<E>public final long retainAll(XGettingCollection<? extends E> samples)
XRemovingCollectionBasically intersect this collection with the given collection and only keeping the resulting elements.
retainAll in interface XRemovingCollection<E>samples - to retainpublic final long removeBy(Predicate<? super E> predicate)
removeBy in interface XProcessingCollection<E>public final void truncate()
XRemovingCollectiontruncate in interface Truncateabletruncate in interface XRemovingCollection<E>public final SubListProcessor<E> range(long fromIndex, long toIndex)
range in interface XDecreasingList<E>range in interface XDecreasingSequence<E>range in interface XGettingList<E>range in interface XGettingSequence<E>range in interface XSettingList<E>range in interface XSettingSequence<E>range in class SubListView<E>public final long consolidate()
ConsolidatableCollectionWeakReference entries whose reference has
been cleared).consolidate in interface ConsolidatableCollectionconsolidate in interface XRemovingCollection<E>public final <C extends Consumer<? super E>> C moveTo(C target, Predicate<? super E> predicate)
moveTo in interface XProcessingCollection<E>public final long optimize()
XRemovingCollectionIf this is not possible or not needed in the concreate 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.
optimize in interface OptimizableCollectionoptimize in interface XRemovingCollection<E>public final <C extends Consumer<? super E>> C moveSelection(C target, long... indices)
moveSelection in interface XProcessingSequence<E>public final E removeAt(long index) throws UnsupportedOperationException
removeAt in interface XProcessingSequence<E>UnsupportedOperationExceptionpublic final E fetch()
fetch in interface XProcessingCollection<E>public final E pop()
pop in interface XProcessingSequence<E>public final E pinch()
pinch in interface XProcessingCollection<E>public final E pick()
pick in interface XProcessingSequence<E>public final SubListProcessor<E> removeRange(long startIndex, long length)
removeRange in interface XRemovingSequence<E>public final SubListProcessor<E> retainRange(long startIndex, long length)
XRemovingSequenceretainRange in interface XRemovingSequence<E>startIndex - is the index of the first element to retainlength - is the amount of elements to retainpublic final long removeSelection(long[] indices)
removeSelection in interface XRemovingSequence<E>public final SubListProcessor<E> toReversed()
XGettingSequenceXGettingSequence with the reversed order of elements.
This method creates a new collection and does not change the existing collection.
toReversed in interface XDecreasingList<E>toReversed in interface XDecreasingSequence<E>toReversed in interface XGettingList<E>toReversed in interface XGettingSequence<E>toReversed in interface XProcessingList<E>toReversed in interface XProcessingSequence<E>toReversed in interface XSettingList<E>toReversed in interface XSettingSequence<E>toReversed in interface XSortableSequence<E>toReversed in class SubListView<E>public final SubListProcessor<E> copy()
XGettingSequencecopy in interface XDecreasingList<E>copy in interface XDecreasingSequence<E>copy in interface XGettingBag<E>copy in interface XGettingCollection<E>copy in interface XGettingList<E>copy in interface XGettingSequence<E>copy in interface XProcessingBag<E>copy in interface XProcessingList<E>copy in interface XReplacingBag<E>copy in interface XSettingList<E>copy in interface XSettingSequence<E>copy in interface XSortableSequence<E>copy in interface Copyablecopy in class SubListView<E>public final long nullRemove()
nullRemove in interface XRemovingCollection<E>public final SubListView<E> view(long fromIndex, long toIndex)
XGettingSequence
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.
view in interface XGettingList<E>view in interface XGettingSequence<E>view in interface XProcessingSequence<E>view in class SubListView<E>fromIndex - defines lower boundary for the view of the collection.toIndex - defines higher boundary for the view of the collection.public final one.microstream.collections.SubListProcessor.OldSubListProcessor<E> old()
old in interface XGettingCollection<E>old in interface XGettingList<E>old in class SubListView<E>public final boolean replaceOne(E element, E replacement)
XReplacingBagreplaceOne in interface XReplacingBag<E>element - to replacereplacement - for the found elementtrue if element is found, false if notpublic final long replace(E element, E replacement)
replace in interface XReplacingBag<E>public final long replaceAll(XGettingCollection<? extends E> elements, E replacement)
replaceAll in interface XReplacingBag<E>public final boolean replaceOne(Predicate<? super E> predicate, E substitute)
replaceOne in interface XReplacingBag<E>public final long replace(Predicate<? super E> predicate, E substitute)
replace in interface XReplacingBag<E>public final long substitute(Function<? super E,? extends E> mapper)
substitute in interface XReplacingCollection<E>public final long substitute(Predicate<? super E> predicate, Function<E,E> mapper)
substitute in interface XReplacingBag<E>public final boolean set(long index,
E element)
throws IndexOutOfBoundsException,
ArrayIndexOutOfBoundsException
set in interface XSettingSequence<E>IndexOutOfBoundsExceptionArrayIndexOutOfBoundsExceptionpublic final E setGet(long index, E element)
setGet in interface XSettingSequence<E>public final void setFirst(E element)
setFirst in interface XSettingSequence<E>public final void setLast(E element)
setLast in interface XSettingSequence<E>public final XSortableSequence<E> shiftTo(long sourceIndex, long targetIndex)
XOrderingSequenceDoes not expand or shrink the capacity of the sequence.
Throws a IndexExceededException if sourceIndex or targetIndex are
greater than the size of the sequence.
shiftTo in interface XOrderingSequence<E>shiftTo in interface XSortableSequence<E>sourceIndex - points to the source element; Index of the source elementtargetIndex - points to the target element; Index of the target elementpublic final XSortableSequence<E> shiftTo(long sourceIndex, long targetIndex, long length)
XOrderingSequenceDoes not expand or shrink the capacity of the sequence.
Throws a IndexExceededException if sourceIndex or targetIndex
exceed the size of the sequence.
shiftTo in interface XOrderingSequence<E>shiftTo in interface XSortableSequence<E>sourceIndex - points to the source element; Index of the source elementtargetIndex - points to the target element; Index of the target elementlength - Amount of moved elements.public final XSortableSequence<E> shiftBy(long sourceIndex, long distance)
XOrderingSequenceDoes not expand or shrink the capacity of the sequence.
Throws a IndexExceededException if sourceIndex or targetIndex
(sourceIndex+distance) exceed the size of the sequence.
shiftBy in interface XOrderingSequence<E>shiftBy in interface XSortableSequence<E>sourceIndex - points to the source element; Index of the source elementdistance - of how far the element should be moved.
Example: 1 moves the element from position 21 to position 22public final XSortableSequence<E> shiftBy(long sourceIndex, long distance, long length)
XOrderingSequenceDoes not expand or shrink the capacity of the sequence.
Throws a IndexExceededException if sourceIndex or targetIndex
(sourceIndex+distance+length) exceed the size of the sequence.
shiftBy in interface XOrderingSequence<E>shiftBy in interface XSortableSequence<E>sourceIndex - points to the source element; Index of the source elementdistance - of how far the element should be moved.
Example: 1 moves the element from position 21 to position 22length - Amount of moved elements.@SafeVarargs public final XDecreasingList<E> setAll(long index, E... elements)
setAll in interface XDecreasingList<E>setAll in interface XDecreasingSequence<E>setAll in interface XSettingList<E>setAll in interface XSettingSequence<E>public final XDecreasingList<E> set(long index, E[] elements, int offset, int length)
set in interface XDecreasingList<E>set in interface XDecreasingSequence<E>set in interface XSettingList<E>set in interface XSettingSequence<E>public final XDecreasingList<E> set(long index, XGettingSequence<? extends E> elements, long offset, long length)
set in interface XDecreasingList<E>set in interface XDecreasingSequence<E>set in interface XSettingList<E>set in interface XSettingSequence<E>public final XDecreasingList<E> swap(long indexA, long indexB)
swap in interface XDecreasingList<E>swap in interface XDecreasingSequence<E>swap in interface XOrderingSequence<E>swap in interface XSettingList<E>swap in interface XSettingSequence<E>swap in interface XSortableSequence<E>public final XDecreasingList<E> swap(long indexA, long indexB, long length)
swap in interface XDecreasingList<E>swap in interface XDecreasingSequence<E>swap in interface XOrderingSequence<E>swap in interface XSettingList<E>swap in interface XSettingSequence<E>swap in interface XSortableSequence<E>public final XDecreasingList<E> reverse()
XSortableSequence
Unlike the XSortableSequence.toReversed() method, this method does not create a new collection,
but changes the order of its own elements.
reverse in interface XDecreasingList<E>reverse in interface XDecreasingSequence<E>reverse in interface XOrderingSequence<E>reverse in interface XSettingList<E>reverse in interface XSettingSequence<E>reverse in interface XSortableSequence<E>public final XDecreasingList<E> fill(long offset, long length, E element)
XSettingListnull.fill in interface XDecreasingList<E>fill in interface XSettingList<E>offset - from the start of the collection (start index)length - of how many slots should be filledelement - to use for filling of slotspublic final XDecreasingList<E> sort(Comparator<? super E> comparator)
Sortablesort in interface Sortable<E>sort in interface XDecreasingList<E>sort in interface XDecreasingSequence<E>sort in interface XSettingList<E>sort in interface XSettingSequence<E>sort in interface XSortableSequence<E>comparator - to sort this collectionCopyright © 2022 MicroStream Software. All rights reserved.