public final class AmaltheaIndex
extends Object
An AmaltheaCrossReferenceAdapter is created and attached to the root context of the model.
The adapter maintains an index that allows fast access to inverse references and an index based on object name.
The method getInverseReferences is called from several
generated model objects to compute inverse transient references based on the incoming references.
| Modifier and Type | Method and Description |
|---|---|
static void |
delete(@NonNull EObject eObject)
Deletes the object from its
containing resource
and/or its containing object as well as from any
other feature that references it within the enclosing root context
(resource set, resource or root object). |
static void |
deleteAll(@NonNull Collection<? extends EObject> eObjects)
Deletes the objects from their
containing resource
and/or their containing object as well as from any
other feature that references it within the enclosing root context
(resource set, resource or root object). |
static void |
deleteAll(@NonNull Collection<? extends EObject> eObjects,
boolean recursive)
Deletes the objects from their
containing resource
and/or their containing object as well as from any
other feature that references it within the enclosing root context
(resource set, resource or root object). |
static <T extends INamed> |
getElements(@NonNull Notifier context,
@NonNull Pattern namePattern,
@NonNull Class<T> targetClass)
Finds elements by name pattern and class
|
static <T extends INamed> |
getElements(@NonNull Notifier context,
@NonNull String name,
@NonNull Class<T> targetClass)
Finds elements by name and class
|
static <T> EList<T> |
getInverseReferences(@NonNull EObject eObject,
@NonNull EReference resultEReference,
@NonNull Set<EReference> targetEReferences)
Computes a list of objects that refer to an EObject via dedicated references.
|
public static <T> EList<T> getInverseReferences(@NonNull EObject eObject,
@NonNull EReference resultEReference,
@NonNull Set<EReference> targetEReferences)
This method is called from several generated model objects to compute an inverse transient reference based on the incoming references.
eObject - object that implements a derived transient opposite referenceresultEReference - opposite reference definition (resulting objects are computed)targetEReferences - list of incoming referencespublic static void delete(@NonNull EObject eObject)
containing resource
and/or its containing object as well as from any
other feature that references it within the enclosing root context
(resource set, resource or root object). Contained children of the object
are similarly removed from any features that reference them.eObject - object to deletepublic static void deleteAll(@NonNull Collection<? extends EObject> eObjects)
containing resource
and/or their containing object as well as from any
other feature that references it within the enclosing root context
(resource set, resource or root object). Contained children of the object
are similarly removed from any features that reference them.eObjects - objects to deletepublic static void deleteAll(@NonNull Collection<? extends EObject> eObjects,
boolean recursive)
containing resource
and/or their containing object as well as from any
other feature that references it within the enclosing root context
(resource set, resource or root object).
If recursive is true, contained children of the object are similarly removed
from any features that reference them.eObjects - objects to deleterecursive - true: contained children should also be deletedpublic static <T extends INamed> Set<? extends T> getElements(@NonNull Notifier context,
@NonNull String name,
@NonNull Class<T> targetClass)
context - EObject, Resource or ResourceSetname - StringtargetClass - for example: Label.classpublic static <T extends INamed> Set<? extends T> getElements(@NonNull Notifier context,
@NonNull Pattern namePattern,
@NonNull Class<T> targetClass)
context - EObject, Resource or ResourceSetnamePattern - for example: Pattern.compile("Prefix_.*")targetClass - for example: Label.class