public class SubListAccessor<E> extends SubListView<E> implements XSettingList<E>
XSettingList.Creator<E>XReplacingBag.Factory<E>Copyable.StaticXIterable.Executor<E>XGettingList.Factory<E>| Constructor and Description |
|---|
SubListAccessor(XSettingList<E> list,
long fromIndex,
long toIndex) |
| Modifier and Type | Method and Description |
|---|---|
SubListAccessor<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.
|
SubListAccessor<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. |
one.microstream.collections.SubListAccessor.OldSubListAccessor<E> |
old() |
SubListAccessor<E> |
range(long fromIndex,
long toIndex) |
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) |
SubListAccessor<E> |
reverse()
Reverses the order of its own elements and returns itself.
|
boolean |
set(long index,
E element) |
SubListAccessor<E> |
set(long offset,
E[] src,
int srcIndex,
int srcLength) |
SubListAccessor<E> |
set(long offset,
XGettingSequence<? extends E> elements,
long elementsOffset,
long elementsLength) |
SubListAccessor<E> |
setAll(long offset,
E... elements) |
void |
setFirst(E element) |
E |
setGet(long index,
E element) |
void |
setLast(E element) |
SubListAccessor<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. |
SubListAccessor<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. |
SubListAccessor<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. |
SubListAccessor<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. |
SubListAccessor<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) |
SubListAccessor<E> |
swap(long indexA,
long indexB) |
SubListAccessor<E> |
swap(long indexA,
long indexB,
long length) |
SubListAccessor<E> |
toReversed()
Creates a new
XGettingSequence with the reversed order of elements. |
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, waitat, copySelection, first, hasIndex, indexBy, indexOf, isSorted, last, lastIndexBy, lastIndexOf, maxIndex, minIndex, peek, poll, scanapplies, contains, containsAll, containsId, containsSearched, copyTo, count, countBy, distinct, distinct, equality, equals, equals, equalsContent, except, filterTo, hashCode, intersect, intSize, max, min, nullContained, search, seek, size, toArray, toArray, unionforEach, spliteratorisFull, maximumCapacity, remainingCapacityiterateIndexednullAllowedimmure, listIterator, listIterator, viewpublic SubListAccessor(XSettingList<E> list, long fromIndex, long toIndex)
public long replace(E element, E replacement)
replace in interface XReplacingBag<E>public 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 long substitute(Function<? super E,? extends E> mapper)
substitute in interface XReplacingCollection<E>public long substitute(Predicate<? super E> predicate, Function<E,E> mapper)
substitute in interface XReplacingBag<E>public SubListAccessor<E> range(long fromIndex, long toIndex)
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 SubListAccessor<E> fill(long offset, long length, E element)
XSettingListnull.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 boolean replaceOne(Predicate<? super E> predicate, E substitute)
replaceOne in interface XReplacingBag<E>public SubListAccessor<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 XOrderingSequence<E>reverse in interface XSettingList<E>reverse in interface XSettingSequence<E>reverse in interface XSortableSequence<E>public SubListAccessor<E> setAll(long offset, E... elements)
setAll in interface XSettingList<E>setAll in interface XSettingSequence<E>public SubListAccessor<E> set(long offset, E[] src, int srcIndex, int srcLength)
set in interface XSettingList<E>set in interface XSettingSequence<E>public SubListAccessor<E> set(long offset, XGettingSequence<? extends E> elements, long elementsOffset, long elementsLength)
set in interface XSettingList<E>set in interface XSettingSequence<E>public void setFirst(E element)
setFirst in interface XSettingSequence<E>public void setLast(E element)
setLast in interface XSettingSequence<E>public SubListAccessor<E> sort(Comparator<? super E> comparator)
Sortablesort in interface Sortable<E>sort in interface XSettingList<E>sort in interface XSettingSequence<E>sort in interface XSortableSequence<E>comparator - to sort this collectionpublic SubListAccessor<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 SubListAccessor<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 SubListAccessor<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 SubListAccessor<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.public SubListAccessor<E> swap(long indexA, long indexB)
swap in interface XOrderingSequence<E>swap in interface XSettingList<E>swap in interface XSettingSequence<E>swap in interface XSortableSequence<E>public SubListAccessor<E> swap(long indexA, long indexB, long length)
swap in interface XOrderingSequence<E>swap in interface XSettingList<E>swap in interface XSettingSequence<E>swap in interface XSortableSequence<E>public long replace(Predicate<? super E> predicate, E substitute)
replace in interface XReplacingBag<E>public long replaceAll(XGettingCollection<? extends E> elements, E replacement)
replaceAll in interface XReplacingBag<E>public boolean set(long index,
E element)
set in interface XSettingSequence<E>public E setGet(long index, E element)
setGet in interface XSettingSequence<E>public 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 class SubListView<E>fromIndex - defines lower boundary for the view of the collection.toIndex - defines higher boundary for the view of the collection.public SubListAccessor<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 XGettingList<E>toReversed in interface XGettingSequence<E>toReversed in interface XSettingList<E>toReversed in interface XSettingSequence<E>toReversed in interface XSortableSequence<E>toReversed in class SubListView<E>public SubListAccessor<E> copy()
XGettingSequencecopy in interface XGettingBag<E>copy in interface XGettingCollection<E>copy in interface XGettingList<E>copy in interface XGettingSequence<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 one.microstream.collections.SubListAccessor.OldSubListAccessor<E> old()
old in interface XGettingCollection<E>old in interface XGettingList<E>old in class SubListView<E>Copyright © 2022 MicroStream Software. All rights reserved.