Interface WriteableObjectPool<T extends DataObject>

All Superinterfaces:
Iterable<T>, ObjectPoolFactoryImplementation, ReadableObjectPool<T>
All Known Implementing Classes:
WriteableObjectPoolImpl

public interface WriteableObjectPool<T extends DataObject> extends ReadableObjectPool<T>
A writeable object pool extends the ReadableObjectPool with methods to modify the pool. Therefore, remove and store methods are provided.
Author:
Rainer Maximini
See Also:
  • Method Details

    • remove

      T remove(T object)
      Removes the given data object from the pool. The objectId of the removed object should be automatically removed from the object.
      Parameters:
      object - The object to remove
      Returns:
      The removed object or null if the object was not in the pool.
    • remove

      T remove(String objectId)
      Removes the object with the given offset from the pool. The objectId of the removed object should be automatically removed from the object.
      Parameters:
      objectId - The offset of the object that should be removed.
      Returns:
      The removed object or null if the object was not in the pool.
    • store

      String store(T object)
      Stores a given DataObject into the pool. Thereby, a new unique objectI id is automatically created. If the object is already a member of the pool, nothing will happen.
      Parameters:
      object - The object that should be added.
      Returns:
      The new objectId of the added object.
    • storeAll

      Set<String> storeAll(Collection<T> objects)
      Parameters:
      objects -
      Returns:
    • storeAll

      Set<String> storeAll(ReadableObjectPool<T> objects)
      Parameters:
      objects -
      Returns:
    • removeAll

      void removeAll()
      Removes all items from the pool
    • removeIf

      boolean removeIf(Predicate<? super T> filter)
      Parameters:
      filter - to remove corresponding items from the pool
      Returns:
      whether items have been removed
    • sort

      void sort(Comparator<T> comparator)
      Sorts the objects in pool using the given comparator.
      Parameters:
      comparator -
    • copy

      Returns:
      deep copy of the pool