public class SubCollector<E> extends SubView<E> implements XPuttingSequence<E>
XPuttingSequence.Creator<E>XGettingSequence.Factory<E>XGettingCollection.Creator<E>Copyable.StaticXIterable.Executor<E>| Constructor and Description |
|---|
SubCollector() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(E element) |
boolean |
add(E element)
Adds the passed 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)
Adds the specified element to this collection if it is not already present (optional operation).
|
SubCollector<E> |
putAll(E... elements)
Adds the specified elements to this collection if it is not already present (optional operation).
|
SubCollector<E> |
putAll(E[] elements,
int srcStartIndex,
int srcLength)
Adds the specified elements to this collection if it is not already present (optional operation).
Only the elements with indizes from the srcStartIndex to the srcStartIndex+srcLength are put in the collection. |
SubCollector<E> |
putAll(XGettingCollection<? extends E> elements)
Adds the specified elements to this collection if it is not already present (optional operation).
|
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, viewclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcollectorcurrentFreeCapacityisFull, maximumCapacity, remainingCapacityhasVolatileElements, nullAllowedhasIndexequals, hashCode, intSizeforEach, spliterator@SafeVarargs public final SubCollector<E> putAll(E... elements)
XPuttingCollectionputAll in interface XPuttingCollection<E>putAll in interface XPuttingSequence<E>elements - to addpublic final SubCollector<E> putAll(E[] elements, int srcStartIndex, int srcLength)
XPuttingCollectionputAll in interface XPuttingCollection<E>putAll in interface XPuttingSequence<E>elements - to addsrcStartIndex - start index of elements-array to add to collectionsrcLength - length of elements-array to add to collectionpublic final SubCollector<E> putAll(XGettingCollection<? extends E> elements)
XPuttingCollectionputAll in interface XPuttingCollection<E>putAll in interface XPuttingSequence<E>elements - to addpublic final boolean nullPut()
nullPut in interface XPuttingCollection<E>public final boolean put(E element)
XPuttingCollectionput in interface XPuttingCollection<E>element - to addpublic final boolean add(E element)
XAddingCollectionadd in interface XAddingCollection<E>element - to addtrue if element was added; false if not@SafeVarargs public final SubCollector<E> addAll(E... elements)
addAll in interface XAddingCollection<E>addAll in interface XAddingSequence<E>public final SubCollector<E> addAll(E[] elements, int srcStartIndex, int srcLength)
addAll in interface XAddingCollection<E>addAll in interface XAddingSequence<E>public final SubCollector<E> addAll(XGettingCollection<? extends E> elements)
addAll in interface XAddingCollection<E>addAll in interface XAddingSequence<E>public final void accept(E element)
public final boolean nullAdd()
nullAdd in interface XAddingCollection<E>public final long currentCapacity()
CapacityExtendable
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().
currentCapacity in interface CapacityExtendablepublic final SubCollector<E> ensureCapacity(long minimalCapacity)
ensureCapacity in interface CapacityExtendablepublic final SubCollector<E> ensureFreeCapacity(long minimalFreeCapacity)
CapacityExtendableensureFreeCapacity in interface CapacityExtendableminimalFreeCapacity - the capacity to ensurepublic final long optimize()
OptimizableCollectionoptimize in interface OptimizableCollectionCopyright © 2022 MicroStream Software. All rights reserved.