Package one.microstream.collections
Class SubProcessor<E>
- java.lang.Object
-
- one.microstream.collections.SubView<E>
-
- one.microstream.collections.SubProcessor<E>
-
- All Implemented Interfaces:
Iterable<E>,CapacityCarrying,ConsolidatableCollection,ExtendedCollection<E>,ExtendedSequence<E>,OptimizableCollection,ReleasingCollection<E>,Sized,Truncateable,XGettingCollection<E>,XGettingSequence<E>,XIndexIterable<E>,XIterable<E>,XJoinable<E>,XProcessingCollection<E>,XProcessingSequence<E>,XRemovingCollection<E>,XRemovingSequence<E>,Processable<E>,Clearable,Copyable
public class SubProcessor<E> extends SubView<E> implements XProcessingSequence<E>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface one.microstream.typing.Copyable
Copyable.Static
-
Nested classes/interfaces inherited from interface one.microstream.collections.interfaces.ExtendedCollection
ExtendedCollection.Creator<E,C extends ExtendedCollection<E>>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingCollection
XGettingCollection.Creator<E>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XGettingSequence
XGettingSequence.Factory<E>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XIterable
XIterable.Executor<E>
-
Nested classes/interfaces inherited from interface one.microstream.collections.types.XProcessingSequence
XProcessingSequence.Factory<E>
-
-
Constructor Summary
Constructors Constructor Description SubProcessor()
-
Method Summary
Modifier 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.SubProcessor<E>copy()Creates a true copy of this list which references th same elements in the same order as this list does at the time the method is called.Efetch()<C extends Consumer<? super E>>
CmoveSelection(C target, long... indices)<C extends Consumer<? super E>>
CmoveTo(C target, Predicate<? super E> predicate)longnullRemove()OldCollection<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()Epinch()Epop()<P extends Consumer<? super E>>
Pprocess(P procedure)longremove(E element)longremoveAll(XGettingCollection<? extends E> elements)EremoveAt(long index)longremoveBy(Predicate<? super E> predicate)longremoveDuplicates()longremoveDuplicates(Equalator<? super E> equalator)booleanremoveOne(E element)XProcessingSequence<E>removeRange(long offset, long length)longremoveSelection(long[] indices)longretainAll(XGettingCollection<? extends E> elements)XProcessingSequence<E>retainRange(long offset, long length)Eretrieve(E element)EretrieveBy(Predicate<? super E> predicate)SubProcessor<E>toReversed()voidtruncate()Clears (and reinitializes if needed) this collection in the fastest possible way, i.e.SubProcessor<E>view()-
Methods inherited from class one.microstream.collections.SubView
applies, at, contains, containsAll, containsId, containsSearched, copySelection, copyTo, count, countBy, distinct, distinct, equality, equals, equalsContent, except, filterTo, first, get, hasVolatileElements, immure, indexBy, indexOf, intersect, isEmpty, isFull, isSorted, iterate, iterateIndexed, iterator, join, last, lastIndexBy, lastIndexOf, max, maximumCapacity, maxIndex, min, minIndex, nullAllowed, nullContained, peek, poll, range, remainingCapacity, scan, search, seek, size, toArray, toArray, union, view
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface one.microstream.collections.interfaces.CapacityCarrying
isFull, maximumCapacity, remainingCapacity
-
Methods inherited from interface one.microstream.collections.interfaces.ExtendedCollection
nullAllowed
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface one.microstream.collections.types.XGettingCollection
applies, 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, union
-
Methods inherited from interface one.microstream.collections.types.XGettingSequence
at, copySelection, first, get, hasIndex, immure, indexBy, indexOf, isSorted, last, lastIndexBy, lastIndexOf, maxIndex, minIndex, peek, poll, range, scan
-
Methods inherited from interface one.microstream.collections.types.XIndexIterable
iterateIndexed
-
Methods inherited from interface one.microstream.collections.types.XProcessingCollection
iterate
-
Methods inherited from interface one.microstream.collections.types.XProcessingSequence
view
-
-
-
-
Method Detail
-
fetch
public E fetch()
- Specified by:
fetchin interfaceXProcessingCollection<E>
-
moveSelection
public <C extends Consumer<? super E>> C moveSelection(C target, long... indices)
- Specified by:
moveSelectionin interfaceXProcessingSequence<E>
-
pick
public E pick()
- Specified by:
pickin interfaceXProcessingSequence<E>
-
pinch
public E pinch()
- Specified by:
pinchin interfaceXProcessingCollection<E>
-
pop
public E pop()
- Specified by:
popin interfaceXProcessingSequence<E>
-
removeAt
public E removeAt(long index)
- Specified by:
removeAtin interfaceXProcessingSequence<E>
-
removeRange
public XProcessingSequence<E> removeRange(long offset, long length)
- Specified by:
removeRangein interfaceXRemovingSequence<E>
-
retainRange
public XProcessingSequence<E> retainRange(long offset, long length)
- Specified by:
retainRangein interfaceXRemovingSequence<E>
-
removeSelection
public long removeSelection(long[] indices)
- Specified by:
removeSelectionin interfaceXRemovingSequence<E>
-
retrieve
public E retrieve(E element)
- Specified by:
retrievein interfaceXProcessingCollection<E>
-
retrieveBy
public E retrieveBy(Predicate<? super E> predicate)
- Specified by:
retrieveByin interfaceXProcessingCollection<E>
-
removeOne
public boolean removeOne(E element)
- Specified by:
removeOnein interfaceXRemovingCollection<E>
-
moveTo
public <C extends Consumer<? super E>> C moveTo(C target, Predicate<? super E> predicate)
- Specified by:
moveToin interfaceXProcessingCollection<E>
-
process
public final <P extends Consumer<? super E>> P process(P procedure)
- Specified by:
processin interfaceProcessable<E>
-
removeBy
public long removeBy(Predicate<? super E> predicate)
- Specified by:
removeByin interfaceXProcessingCollection<E>
-
removeDuplicates
public long removeDuplicates(Equalator<? super E> equalator)
- Specified by:
removeDuplicatesin interfaceXProcessingCollection<E>
-
clear
public void clear()
Description copied from interface:XRemovingCollectionClears all elements from the collection while leaving the capacity as it is.- Specified by:
clearin interfaceClearable- Specified by:
clearin interfaceXRemovingCollection<E>
-
consolidate
public long consolidate()
Description copied from interface:XRemovingCollectionConsolidates 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 interfaceConsolidatableCollection- Specified by:
consolidatein interfaceXRemovingCollection<E>- Returns:
- the number of discarded entries.
-
nullRemove
public long nullRemove()
- Specified by:
nullRemovein interfaceXRemovingCollection<E>
-
optimize
public 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 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.
- Specified by:
optimizein interfaceOptimizableCollection- Specified by:
optimizein interfaceXRemovingCollection<E>- Returns:
- the amount of elements that can be added before the internal storage has to be adjusted.
-
remove
public long remove(E element)
- Specified by:
removein interfaceXRemovingCollection<E>
-
removeAll
public long removeAll(XGettingCollection<? extends E> elements)
- Specified by:
removeAllin interfaceXRemovingCollection<E>
-
removeDuplicates
public long removeDuplicates()
- Specified by:
removeDuplicatesin interfaceXRemovingCollection<E>
-
retainAll
public long retainAll(XGettingCollection<? extends E> elements)
- Specified by:
retainAllin interfaceXRemovingCollection<E>
-
truncate
public 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 interfaceTruncateable- Specified by:
truncatein interfaceXRemovingCollection<E>
-
copy
public SubProcessor<E> copy()
Description copied from interface:XGettingSequenceCreates a true copy of this list which references th 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)
-
view
public SubProcessor<E> view()
- Specified by:
viewin interfaceXGettingCollection<E>- Specified by:
viewin interfaceXGettingSequence<E>- Overrides:
viewin classSubView<E>
-
old
public OldCollection<E> old()
-
toReversed
public SubProcessor<E> toReversed()
- Specified by:
toReversedin interfaceXGettingSequence<E>- Specified by:
toReversedin interfaceXProcessingSequence<E>- Overrides:
toReversedin classSubView<E>
-
-