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 theReadableObjectPoolwith methods to modify the pool. Therefore, remove and store methods are provided.- Author:
- Rainer Maximini
- See Also:
ReadableObjectPool,DataObject
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WriteableObjectPool<T>copy()Tremove(String objectId)Removes the object with the given offset from the pool.Tremove(T object)Removes the given data object from the pool.voidremoveAll()Removes all items from the poolvoidsort(Comparator<T> comparator)Sorts the objects in pool using the given comparator.Stringstore(T object)Stores a givenDataObjectinto the pool.Set<String>storeAll(ReadableObjectPool<T> objects)Set<String>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, size, stream, toXML
-
-
-
-
Method Detail
-
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
nullif 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
nullif the object was not in the pool.
-
store
String store(T object)
Stores a givenDataObjectinto 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
-
sort
void sort(Comparator<T> comparator)
Sorts the objects in pool using the given comparator.- Parameters:
comparator-
-
copy
WriteableObjectPool<T> copy()
- Returns:
- deep copy of the pool
-
-