|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.ecp.common.spi.cachetree.AbstractCachedTree<T>
T
- the actual value type that is stored by the treepublic abstract class AbstractCachedTree<T>
A cached tree resembles a tree structure where each node is associated with a specific value. The value stored by parent nodes within the tree hereby are influenced by the values stored within their children. Thus, if the value of a child changes, it needs to be propagated upwards. Analogously, if the child is deleted the value associated with the deleted child must not influence the value of the parent anymore. This class is responsible for adding and removing nodes and for correctly maintaining such parent/child relationships.
Constructor Summary | |
---|---|
AbstractCachedTree(IExcludedObjectsCallback callback)
Private constructor. |
Method Summary | |
---|---|
void |
clear()
Clears the cache. |
T |
getCachedValue(Object eObject)
Returns the cached value stored for the given EObject . |
abstract T |
getDefaultValue()
Returns the default value for a cached node. The root value will be initialized with this value, too |
T |
getRootValue()
Returns the root value of this tree. Note that the root is purely notional. |
void |
remove(org.eclipse.emf.ecore.EObject eObject)
Removes the cache entry that contains the given EObject . |
Set<org.eclipse.emf.ecore.EObject> |
update(org.eclipse.emf.ecore.EObject eObject,
T value)
Updates the cached entry for the given EObject with the given value.If the cached entry does not yet exist, it will be created. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractCachedTree(IExcludedObjectsCallback callback)
callback
- the IExcludedObjectsCallback
to use when checking when to stopMethod Detail |
---|
public abstract T getDefaultValue()
public Set<org.eclipse.emf.ecore.EObject> update(org.eclipse.emf.ecore.EObject eObject, T value)
EObject
with the given value.
eObject
- the EObject
value
- the value associated with the EObject
public T getRootValue()
public T getCachedValue(Object eObject)
EObject
.
eObject
- the EObject
whose cached value should be found
EObject
, if found, otherwise
the default value which is returned via getDefaultValue()
public void remove(org.eclipse.emf.ecore.EObject eObject)
EObject
.
eObject
- the EObject
that needs to be removed from the cached treepublic void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |