public abstract class AbstractRuleDataContainer<T extends java.io.Serializable> extends java.lang.Object implements RuleDataContainer<T>
RuleDataContainer. This implementation is immutable by default - the mutable state
is encapsulated in StorageElementsContainer instance, which is accessed using
getStorageElementsContainer() method. This gives subclasses a freedom of choice where to keep the mutable
state.| Constructor and Description |
|---|
AbstractRuleDataContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(T element)
Adds an element to the container.
|
void |
clear()
Removes all elements from the container
|
boolean |
contains(T element)
Checks if given element is contained within this container.
|
void |
delete(T element)
Removes an element from the container if an element has been added only once.
|
void |
deleteAll(T element)
Removes an element from the container regardless of how many times it has been added.
|
java.util.Collection<T> |
getAll()
Returns all elements that the container holds.
|
protected abstract StorageElementsContainer<T> |
getStorageElementsContainer()
Provides access to actual
StorageElementsContainer instance. |
public void add(T element)
RuleDataContainerRuleDataContainer.getAll() method will return only one
instance of such element. If an element is added many times, the RuleDataContainer.delete(Serializable) method must be
called the same number of times to remove it from the container.add in interface RuleDataContainer<T extends java.io.Serializable>public void clear()
RuleDataContainerclear in interface RuleDataContainer<T extends java.io.Serializable>public boolean contains(T element)
RuleDataContainercontains in interface RuleDataContainer<T extends java.io.Serializable>public void delete(T element)
RuleDataContainerdelete in interface RuleDataContainer<T extends java.io.Serializable>public void deleteAll(T element)
RuleDataContainerRuleDataContainer.contains(Serializable) will return false.deleteAll in interface RuleDataContainer<T extends java.io.Serializable>public java.util.Collection<T> getAll()
RuleDataContainergetAll in interface RuleDataContainer<T extends java.io.Serializable>protected abstract StorageElementsContainer<T> getStorageElementsContainer()
StorageElementsContainer instance.Copyright © 2018 SAP SE. All Rights Reserved.