Package one.microstream.collections
Class Collector<E>
- java.lang.Object
- 
- one.microstream.collections.Collector<E>
 
- 
- All Implemented Interfaces:
- Consumer<E>,- CapacityCarrying,- CapacityExtendable,- ExtendedCollection<E>,- OptimizableCollection,- Sized,- XAddingCollection<E>,- XPuttingCollection<E>
 
 public final class Collector<E> extends Object implements XPuttingCollection<E> 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface one.microstream.collections.types.XPuttingCollectionXPuttingCollection.Creator<E>
 
- 
 - 
Constructor SummaryConstructors Constructor Description Collector(XPuttingCollection<E> collection)
 - 
Method SummaryModifier and Type Method Description voidaccept(E e)booleanadd(E e)Collector<E>addAll(E... elements)Collector<E>addAll(E[] elements, int offset, int length)Collector<E>addAll(XGettingCollection<? extends E> elements)longcurrentCapacity()Returns the current amount of elements this instance can hold before a storage rebuild becomes necessary.Collector<E>ensureCapacity(long minimalCapacity)Collector<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.booleanhasVolatileElements()booleanisEmpty()booleanisFull()Returns true if the current capacity cannot be increased any more.longmaximumCapacity()Returns the maximum amount of elements this carrier instance can contain.
 The actual value may be depend on the configuration of the concrete instance or may depend only on the implementation of the carrier (meaning it is constant for all instances of the implementation, e.g.booleannullAdd()booleannullAllowed()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)Collector<E>putAll(E... elements)Collector<E>putAll(E[] elements, int offset, int length)Collector<E>putAll(XGettingCollection<? extends E> elements)longremainingCapacity()Returns the amount of elements this carrier instance can collect before reaching its maximimum capacity.longsize()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface one.microstream.collections.interfaces.CapacityExtendablecurrentFreeCapacity
 - 
Methods inherited from interface one.microstream.collections.types.XAddingCollectioncollector
 
- 
 
- 
- 
- 
Constructor Detail- 
Collectorpublic Collector(XPuttingCollection<E> collection) 
 
- 
 - 
Method Detail- 
nullAddpublic boolean nullAdd() - Specified by:
- nullAddin interface- XAddingCollection<E>
 
 - 
addpublic boolean add(E e) - Specified by:
- addin interface- XAddingCollection<E>
 
 - 
addAllpublic Collector<E> addAll(E... elements) - Specified by:
- addAllin interface- XAddingCollection<E>
 
 - 
addAllpublic Collector<E> addAll(E[] elements, int offset, int length) - Specified by:
- addAllin interface- XAddingCollection<E>
 
 - 
addAllpublic Collector<E> addAll(XGettingCollection<? extends E> elements) - Specified by:
- addAllin interface- XAddingCollection<E>
 
 - 
nullPutpublic boolean nullPut() - Specified by:
- nullPutin interface- XPuttingCollection<E>
 
 - 
acceptpublic void accept(E e) 
 - 
putpublic boolean put(E element) - Specified by:
- putin interface- XPuttingCollection<E>
 
 - 
putAllpublic Collector<E> putAll(E... elements) - Specified by:
- putAllin interface- XPuttingCollection<E>
 
 - 
putAllpublic Collector<E> putAll(E[] elements, int offset, int length) - Specified by:
- putAllin interface- XPuttingCollection<E>
 
 - 
putAllpublic Collector<E> putAll(XGettingCollection<? extends E> elements) - Specified by:
- putAllin interface- XPuttingCollection<E>
 
 - 
ensureCapacitypublic Collector<E> ensureCapacity(long minimalCapacity) - Specified by:
- ensureCapacityin interface- CapacityExtendable
 
 - 
currentCapacitypublic 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 interface- CapacityExtendable
- Returns:
- the current capacity of this instance before a rebuild is required.
 
 - 
maximumCapacitypublic long maximumCapacity() Description copied from interface:CapacityCarryingReturns the maximum amount of elements this carrier instance can contain.
 The actual value may be depend on the configuration of the concrete instance or may depend only on the implementation of the carrier (meaning it is constant for all instances of the implementation, e.g.Integer.MAX_VALUE)- Specified by:
- maximumCapacityin interface- CapacityCarrying
- Returns:
- the maximum amount of elements this carrier instance can contain.
 
 - 
isFullpublic boolean isFull() Description copied from interface:CapacityCarryingReturns true if the current capacity cannot be increased any more.- Specified by:
- isFullin interface- CapacityCarrying
 
 - 
remainingCapacitypublic long remainingCapacity() Description copied from interface:CapacityCarryingReturns the amount of elements this carrier instance can collect before reaching its maximimum capacity.- Specified by:
- remainingCapacityin interface- CapacityCarrying
 
 - 
ensureFreeCapacitypublic Collector<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 interface- CapacityExtendable
 
 - 
optimizepublic 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 interface- OptimizableCollection
- Returns:
- the storage size of the collection after the optimzation.
 
 - 
hasVolatileElementspublic boolean hasVolatileElements() - Specified by:
- hasVolatileElementsin interface- ExtendedCollection<E>
 
 - 
nullAllowedpublic boolean nullAllowed() - Specified by:
- nullAllowedin interface- ExtendedCollection<E>
 
 - 
isEmptypublic boolean isEmpty() throws UnsupportedOperationException- Specified by:
- isEmptyin interface- Sized
- Throws:
- UnsupportedOperationException
 
 - 
sizepublic long size() throws UnsupportedOperationException- Specified by:
- sizein interface- Sized
- Throws:
- UnsupportedOperationException
 
 
- 
 
-