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.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, viewMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface one.microstream.collections.interfaces.CapacityCarrying
isFull, maximumCapacity, remainingCapacityMethods inherited from interface one.microstream.collections.interfaces.ExtendedCollection
nullAllowedMethods 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, unionMethods 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
-
Constructor Details
-
SubProcessor
public SubProcessor()
-
-
Method Details
-
fetch
- Specified by:
fetchin interfaceXProcessingCollection<E>
-
moveSelection
- Specified by:
moveSelectionin interfaceXProcessingSequence<E>
-
pick
- Specified by:
pickin interfaceXProcessingSequence<E>
-
pinch
- Specified by:
pinchin interfaceXProcessingCollection<E>
-
pop
- Specified by:
popin interfaceXProcessingSequence<E>
-
removeAt
- Specified by:
removeAtin interfaceXProcessingSequence<E>
-
removeRange
- Specified by:
removeRangein interfaceXRemovingSequence<E>
-
retainRange
- Specified by:
retainRangein interfaceXRemovingSequence<E>
-
removeSelection
public long removeSelection(long[] indices)- Specified by:
removeSelectionin interfaceXRemovingSequence<E>
-
retrieve
- Specified by:
retrievein interfaceXProcessingCollection<E>
-
retrieveBy
- Specified by:
retrieveByin interfaceXProcessingCollection<E>
-
removeOne
- Specified by:
removeOnein interfaceXRemovingCollection<E>
-
moveTo
- Specified by:
moveToin interfaceXProcessingCollection<E>
-
process
- Specified by:
processin interfaceProcessable<E>
-
removeBy
- Specified by:
removeByin interfaceXProcessingCollection<E>
-
removeDuplicates
- 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
- Specified by:
removein interfaceXRemovingCollection<E>
-
removeAll
- Specified by:
removeAllin interfaceXRemovingCollection<E>
-
removeDuplicates
public long removeDuplicates()- Specified by:
removeDuplicatesin interfaceXRemovingCollection<E>
-
retainAll
- 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
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
- Specified by:
viewin interfaceXGettingCollection<E>- Specified by:
viewin interfaceXGettingSequence<E>- Overrides:
viewin classSubView<E>
-
old
-
toReversed
- Specified by:
toReversedin interfaceXGettingSequence<E>- Specified by:
toReversedin interfaceXProcessingSequence<E>- Overrides:
toReversedin classSubView<E>
-