Interface WriteableObjectPool<T extends DataObject>
- All Superinterfaces:
Iterable<T>
,ObjectPoolFactoryImplementation
,ReadableObjectPool<T>
- All Known Implementing Classes:
WriteableObjectPoolImpl
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 Summary
Modifier and TypeMethodDescriptioncopy()
Removes the object with the given offset from the pool.Removes the given data object from the pool.void
Removes all items from the poolboolean
void
sort
(Comparator<T> comparator) Sorts the objects in pool using the given comparator.Stores a givenDataObject
into the pool.storeAll
(ReadableObjectPool<T> objects) storeAll
(Collection<T> objects) Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface de.uni_trier.wi2.procake.data.objectpool.ObjectPoolFactoryImplementation
newObjectId
Methods inherited from interface de.uni_trier.wi2.procake.data.objectpool.ReadableObjectPool
getCollection, getId, getNESTGraphIds, getNESTGraphObjectsRecursively, getObject, getObjectIds, getObjectIds, hasSameValueAsIn, iterator, setId, size, stream, toXML
-
Method Details
-
remove
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
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
Stores a givenDataObject
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
- Parameters:
objects
-- Returns:
-
storeAll
- Parameters:
objects
-- Returns:
-
removeAll
void removeAll()Removes all items from the pool -
removeIf
- Parameters:
filter
- to remove corresponding items from the pool- Returns:
- whether items have been removed
-
sort
Sorts the objects in pool using the given comparator.- Parameters:
comparator
-
-
copy
WriteableObjectPool<T> copy()- Returns:
- deep copy of the pool
-