Interface XRemovingCollection<E>
- All Superinterfaces:
Clearable,ConsolidatableCollection,ExtendedCollection<E>,OptimizableCollection,ReleasingCollection<E>,Sized,Truncateable
- All Known Subinterfaces:
XBag<E>,XBasicEnum<E>,XBasicList<E>,XBasicSequence<E>,XBasicTable<K,V>,XBasicTable.Keys<K,V>,XBasicTable.Values<K,V>,XChart<K,V>,XChart.Keys<K,V>,XChart.Values<K,V>,XCollection<E>,XDecreasingEnum<E>,XDecreasingList<E>,XDecreasingSequence<E>,XEnum<E>,XLadder<E>,XList<E>,XMap<K,V>,XMap.Keys<K,V>,XMap.Values<K,V>,XProcessingBag<E>,XProcessingCollection<E>,XProcessingEnum<E>,XProcessingList<E>,XProcessingMap.Keys<K,V>,XProcessingMap.Values<K,V>,XProcessingSequence<E>,XProcessingSet<E>,XProcessingSortation<E>,XRank<E>,XRemovingBag<E>,XRemovingEnum<E>,XRemovingList<E>,XRemovingSequence<E>,XRemovingSet<E>,XRemovingSortation<E>,XSequence<E>,XSet<E>,XSortation<E>,XTable<K,V>,XTable.Keys<K,V>,XTable.Values<K,V>
- All Known Implementing Classes:
ArrayCollector,BulkList,EnumProcessor,EqBulkList,EqHashEnum,EqHashTable,EqHashTable.Keys,EqHashTable.Values,HashEnum,HashTable,HashTable.Keys,HashTable.Values,LimitList,ListProcessor,LockedCollection,LockedList,LockedMap,MutexSet,OpenAdressingMiniSet,Single,SubList,SubListProcessor,SubProcessor,SynchCollection,SynchList,SynchSet
public interface XRemovingCollection<E> extends ExtendedCollection<E>, Truncateable, ConsolidatableCollection, OptimizableCollection, ReleasingCollection<E>
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceXRemovingCollection.Factory<E>Nested classes/interfaces inherited from interface one.microstream.collections.interfaces.ExtendedCollection
ExtendedCollection.Creator<E,C extends ExtendedCollection<E>> -
Method Summary
Modifier and Type Method Description voidclear()Clears all elements from the collection while leaving the capacity as it is.longconsolidate()Consolidates the internal storage of this collection by discarding all elements of the internal storage that have become obsolete or otherwise unneeded anymore.longnullRemove()longoptimize()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.longremove(E element)longremoveAll(XGettingCollection<? extends E> elements)longremoveDuplicates()booleanremoveOne(E element)longretainAll(XGettingCollection<? extends E> elements)Removing all elements except the ones contained in the given elements-collection.voidtruncate()Clears (and reinitializes if needed) this collection in the fastest possible way, i.e.Methods inherited from interface one.microstream.collections.interfaces.ExtendedCollection
hasVolatileElements, nullAllowed
-
Method Details
-
clear
void clear()Clears all elements from the collection while leaving the capacity as it is. -
truncate
void truncate()Clears (and reinitializes if needed) this collection in the fastest possible way, i.e. by allocating a new and empty internal storage of default capacity. The collection will be empty after calling this method.- Specified by:
truncatein interfaceTruncateable
-
consolidate
long consolidate()Description copied from interface:ConsolidatableCollectionConsolidates the internal storage of this collection by discarding all elements of the internal storage that have become obsolete or otherwise unneeded anymore. (e.g.WeakReferenceentries whose reference has been cleared).- Specified by:
consolidatein interfaceConsolidatableCollection- Returns:
- the number of discarded entries.
-
optimize
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. hash density).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.
- Specified by:
optimizein interfaceOptimizableCollection- Returns:
- the amount of elements that can be added before the internal storage has to be adjusted.
-
nullRemove
long nullRemove() -
removeOne
-
remove
-
removeAll
-
retainAll
Removing all elements except the ones contained in the given elements-collection.Basically intersect this collection with the given collection and only keeping the resulting elements.
- Parameters:
elements- to retain- Returns:
- Amount of deleted elements
-
removeDuplicates
long removeDuplicates()
-