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.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)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)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)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).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, 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.CapacityExtendable
currentFreeCapacityMethods inherited from interface one.microstream.collections.interfaces.ExtendedCollection
nullAllowedMethods inherited from interface one.microstream.collections.types.XGettingCollection
equals, hashCode, intSize
-
Constructor Details
-
SubCollector
public SubCollector()
-
-
Method Details
-
putAll
Description copied from interface:XPuttingCollectionAdds the specified elements to this collection if it is not already present (optional operation).- Specified by:
putAllin interfaceXPuttingCollection<E>- Specified by:
putAllin interfaceXPuttingSequence<E>- Parameters:
elements- to add- Returns:
- this
-
putAll
Description copied from interface:XPuttingCollectionAdds 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.- Specified by:
putAllin interfaceXPuttingCollection<E>- Specified by:
putAllin interfaceXPuttingSequence<E>- Parameters:
elements- to addsrcStartIndex- start index of elements-array to add to collectionsrcLength- length of elements-array to add to collection- Returns:
- this
-
putAll
Description copied from interface:XPuttingCollectionAdds the specified elements to this collection if it is not already present (optional operation).- Specified by:
putAllin interfaceXPuttingCollection<E>- Specified by:
putAllin interfaceXPuttingSequence<E>- Parameters:
elements- to add- Returns:
- this
-
nullPut
public final boolean nullPut()- Specified by:
nullPutin interfaceXPuttingCollection<E>
-
put
Description copied from interface:XPuttingCollectionAdds the specified element to this collection if it is not already present (optional operation).- Specified by:
putin interfaceXPuttingCollection<E>- Parameters:
element- to add- Returns:
- true if this collection did not already contain the specified element
-
add
Description copied from interface:XAddingCollectionAdds the passed element.- Specified by:
addin interfaceXAddingCollection<E>- Parameters:
element- to add- Returns:
trueif element was added;falseif not
-
addAll
- Specified by:
addAllin interfaceXAddingCollection<E>- Specified by:
addAllin interfaceXAddingSequence<E>
-
addAll
- Specified by:
addAllin interfaceXAddingCollection<E>- Specified by:
addAllin interfaceXAddingSequence<E>
-
addAll
- Specified by:
addAllin interfaceXAddingCollection<E>- Specified by:
addAllin interfaceXAddingSequence<E>
-
accept
-
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
- Specified by:
ensureCapacityin interfaceCapacityExtendable
-
ensureFreeCapacity
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.
-