Package one.microstream.collections
Class SubCollector<E>
- java.lang.Object
-
- one.microstream.collections.SubView<E>
-
- one.microstream.collections.SubCollector<E>
-
- All Implemented Interfaces:
Iterable<E>,Consumer<E>,CapacityCarrying,CapacityExtendable,ExtendedCollection<E>,ExtendedSequence<E>,OptimizableCollection,Sized,XAddingCollection<E>,XAddingSequence<E>,XGettingCollection<E>,XGettingSequence<E>,XIndexIterable<E>,XIterable<E>,XJoinable<E>,XPuttingCollection<E>,XPuttingSequence<E>,Copyable
public class SubCollector<E> extends SubView<E> implements XPuttingSequence<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.XPuttingSequence
XPuttingSequence.Creator<E>
-
-
Constructor Summary
Constructors Constructor Description SubCollector()
-
Method Summary
Modifier and Type Method Description voidaccept(E element)booleanadd(E element)SubCollector<E>addAll(E... elements)SubCollector<E>addAll(E[] elements, int srcStartIndex, int srcLength)SubCollector<E>addAll(XGettingCollection<? extends E> elements)longcurrentCapacity()Returns the current amount of elements this instance can hold before a storage rebuild becomes necessary.SubCollector<E>ensureCapacity(long minimalCapacity)SubCollector<E>ensureFreeCapacity(long minimalFreeCapacity)Ensures that the next minimalFreeCapacity elements can be actually added in a fast way, meaning for example no internal storage rebuild will be necessary.booleannullAdd()booleannullPut()longoptimize()Optimizes the internal storage of this collection and returns the storage size of the collection after the process is complete.booleanput(E element)SubCollector<E>putAll(E... elements)SubCollector<E>putAll(E[] elements, int srcStartIndex, int srcLength)SubCollector<E>putAll(XGettingCollection<? extends E> elements)-
Methods inherited from class one.microstream.collections.SubView
applies, at, contains, containsAll, containsId, containsSearched, copy, 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, old, peek, poll, range, remainingCapacity, scan, search, seek, size, toArray, toArray, toReversed, union, view, 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.CapacityExtendable
currentFreeCapacity
-
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.XAddingCollection
collector
-
Methods inherited from interface one.microstream.collections.types.XGettingCollection
equals, hashCode, intSize
-
Methods inherited from interface one.microstream.collections.types.XGettingSequence
hasIndex
-
-
-
-
Method Detail
-
putAll
@SafeVarargs public final SubCollector<E> putAll(E... elements)
- Specified by:
putAllin interfaceXPuttingCollection<E>- Specified by:
putAllin interfaceXPuttingSequence<E>
-
putAll
public final SubCollector<E> putAll(E[] elements, int srcStartIndex, int srcLength)
- Specified by:
putAllin interfaceXPuttingCollection<E>- Specified by:
putAllin interfaceXPuttingSequence<E>
-
putAll
public final SubCollector<E> putAll(XGettingCollection<? extends E> elements)
- Specified by:
putAllin interfaceXPuttingCollection<E>- Specified by:
putAllin interfaceXPuttingSequence<E>
-
nullPut
public final boolean nullPut()
- Specified by:
nullPutin interfaceXPuttingCollection<E>
-
put
public final boolean put(E element)
- Specified by:
putin interfaceXPuttingCollection<E>
-
add
public final boolean add(E element)
- Specified by:
addin interfaceXAddingCollection<E>
-
addAll
@SafeVarargs public final SubCollector<E> addAll(E... elements)
- Specified by:
addAllin interfaceXAddingCollection<E>- Specified by:
addAllin interfaceXAddingSequence<E>
-
addAll
public final SubCollector<E> addAll(E[] elements, int srcStartIndex, int srcLength)
- Specified by:
addAllin interfaceXAddingCollection<E>- Specified by:
addAllin interfaceXAddingSequence<E>
-
addAll
public final SubCollector<E> addAll(XGettingCollection<? extends E> elements)
- Specified by:
addAllin interfaceXAddingCollection<E>- Specified by:
addAllin interfaceXAddingSequence<E>
-
accept
public final void accept(E element)
-
nullAdd
public final boolean nullAdd()
- Specified by:
nullAddin interfaceXAddingCollection<E>
-
currentCapacity
public final long currentCapacity()
Description copied from interface:CapacityExtendableReturns the current amount of elements this instance can hold before a storage rebuild becomes necessary.For carrier implementations that don't have a concept of storage rebuilding (like linked list for example) this method returns the same value as
CapacityCarrying.maximumCapacity().- Specified by:
currentCapacityin interfaceCapacityExtendable- Returns:
- the current capacity of this instance before a rebuild is required.
-
ensureCapacity
public final SubCollector<E> ensureCapacity(long minimalCapacity)
- Specified by:
ensureCapacityin interfaceCapacityExtendable
-
ensureFreeCapacity
public final SubCollector<E> ensureFreeCapacity(long minimalFreeCapacity)
Description copied from interface:CapacityExtendableEnsures that the next minimalFreeCapacity elements can be actually added in a fast way, meaning for example no internal storage rebuild will be necessary.- Specified by:
ensureFreeCapacityin interfaceCapacityExtendable
-
optimize
public final long optimize()
Description copied from interface:OptimizableCollectionOptimizes the internal storage of this collection and returns the storage size of the collection after the process is complete.- Specified by:
optimizein interfaceOptimizableCollection- Returns:
- the storage size of the collection after the optimzation.
-
-