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 interface  XRemovingCollection.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
    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.

    Methods inherited from interface one.microstream.collections.interfaces.ExtendedCollection

    hasVolatileElements, nullAllowed

    Methods inherited from interface one.microstream.collections.interfaces.Sized

    isEmpty, size
  • Method Details

    • clear

      void clear()
      Clears all elements from the collection while leaving the capacity as it is.
      Specified by:
      clear in interface Clearable
    • 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:
      truncate in interface Truncateable
    • consolidate

      long consolidate()
      Description copied from interface: ConsolidatableCollection
      Consolidates the internal storage of this collection by discarding all elements of the internal storage that have become obsolete or otherwise unneeded anymore. (e.g. WeakReference entries whose reference has been cleared).
      Specified by:
      consolidate in interface ConsolidatableCollection
      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:
      optimize in interface OptimizableCollection
      Returns:
      the amount of elements that can be added before the internal storage has to be adjusted.
    • nullRemove

      long nullRemove()
    • removeOne

      boolean removeOne​(E element)
    • remove

      long remove​(E element)
    • removeAll

      long removeAll​(XGettingCollection<? extends E> elements)
    • retainAll

      long retainAll​(XGettingCollection<? extends E> elements)
      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()