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 void
accept(E element)
boolean
add(E element)
SubCollector<E>
addAll(E... elements)
SubCollector<E>
addAll(E[] elements, int srcStartIndex, int srcLength)
SubCollector<E>
addAll(XGettingCollection<? extends E> elements)
long
currentCapacity()
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.boolean
nullAdd()
boolean
nullPut()
long
optimize()
Optimizes the internal storage of this collection and returns the storage size of the collection after the process is complete.boolean
put(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:
putAll
in interfaceXPuttingCollection<E>
- Specified by:
putAll
in interfaceXPuttingSequence<E>
-
putAll
public final SubCollector<E> putAll(E[] elements, int srcStartIndex, int srcLength)
- Specified by:
putAll
in interfaceXPuttingCollection<E>
- Specified by:
putAll
in interfaceXPuttingSequence<E>
-
putAll
public final SubCollector<E> putAll(XGettingCollection<? extends E> elements)
- Specified by:
putAll
in interfaceXPuttingCollection<E>
- Specified by:
putAll
in interfaceXPuttingSequence<E>
-
nullPut
public final boolean nullPut()
- Specified by:
nullPut
in interfaceXPuttingCollection<E>
-
put
public final boolean put(E element)
- Specified by:
put
in interfaceXPuttingCollection<E>
-
add
public final boolean add(E element)
- Specified by:
add
in interfaceXAddingCollection<E>
-
addAll
@SafeVarargs public final SubCollector<E> addAll(E... elements)
- Specified by:
addAll
in interfaceXAddingCollection<E>
- Specified by:
addAll
in interfaceXAddingSequence<E>
-
addAll
public final SubCollector<E> addAll(E[] elements, int srcStartIndex, int srcLength)
- Specified by:
addAll
in interfaceXAddingCollection<E>
- Specified by:
addAll
in interfaceXAddingSequence<E>
-
addAll
public final SubCollector<E> addAll(XGettingCollection<? extends E> elements)
- Specified by:
addAll
in interfaceXAddingCollection<E>
- Specified by:
addAll
in interfaceXAddingSequence<E>
-
accept
public final void accept(E element)
-
nullAdd
public final boolean nullAdd()
- Specified by:
nullAdd
in interfaceXAddingCollection<E>
-
currentCapacity
public final long currentCapacity()
Description copied from interface:CapacityExtendable
Returns 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:
currentCapacity
in interfaceCapacityExtendable
- Returns:
- the current capacity of this instance before a rebuild is required.
-
ensureCapacity
public final SubCollector<E> ensureCapacity(long minimalCapacity)
- Specified by:
ensureCapacity
in interfaceCapacityExtendable
-
ensureFreeCapacity
public final SubCollector<E> ensureFreeCapacity(long minimalFreeCapacity)
Description copied from interface:CapacityExtendable
Ensures 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:
ensureFreeCapacity
in interfaceCapacityExtendable
-
optimize
public final long optimize()
Description copied from interface:OptimizableCollection
Optimizes the internal storage of this collection and returns the storage size of the collection after the process is complete.- Specified by:
optimize
in interfaceOptimizableCollection
- Returns:
- the storage size of the collection after the optimzation.
-
-