public interface XRemovingCollection<E> extends ExtendedCollection<E>, Truncateable, ConsolidatableCollection, OptimizableCollection, ReleasingCollection<E>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
XRemovingCollection.Factory<E> |
ExtendedCollection.Creator<E,C extends ExtendedCollection<E>>| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears all elements from the collection while leaving the capacity as it is.
|
long |
consolidate()
Consolidates the internal storage of this collection by discarding all elements of the internal storage that
have become obsolete or otherwise unneeded anymore.
|
long |
nullRemove() |
long |
optimize()
Optimizes internal memory usage by rebuilding the storage to only occupy as much memory as needed to store
the currently contained elements in terms of the collection's current memory usage configuration
(e.g.
|
long |
remove(E element) |
long |
removeAll(XGettingCollection<? extends E> elements) |
long |
removeDuplicates() |
boolean |
removeOne(E element) |
long |
retainAll(XGettingCollection<? extends E> elements)
Removing all elements except the ones contained in the given elements-collection.
|
void |
truncate()
Clears (and reinitializes if needed) this collection in the fastest possible way, i.e.
|
hasVolatileElements, nullAllowedvoid clear()
void truncate()
truncate in interface Truncateablelong consolidate()
ConsolidatableCollectionWeakReference entries whose reference has
been cleared).consolidate in interface ConsolidatableCollectionlong optimize()
If this is not possible or not needed in the concreate implementation, this method does nothing.
Note that this method can consume a considerable amount of time depending on the implementation and should only be called intentionally and accurately when reducing occupied memory is needed.
optimize in interface OptimizableCollectionlong nullRemove()
boolean removeOne(E element)
long remove(E element)
long removeAll(XGettingCollection<? extends E> elements)
long retainAll(XGettingCollection<? extends E> elements)
Basically intersect this collection with the given collection and only keeping the resulting elements.
elements - to retainlong removeDuplicates()
Copyright © 2022 MicroStream Software. All rights reserved.