public interface IdEObjectCollection extends org.eclipse.emf.ecore.EObject, ESObjectContainer<ModelElementId>, ModelElementIdToEObjectMapping
EObjects where each one can be identified via a ModelElementId. EObjects can
be added and deleted and checked
whether they are part of the collection.| Modifier and Type | Method and Description |
|---|---|
void |
addModelElement(org.eclipse.emf.ecore.EObject modelElement)
Adds the given model element to the collection.
|
void |
allocateModelElementIds(Map<org.eclipse.emf.ecore.EObject,ModelElementId> modelElementToIdMap)
Allocates certain IDs for the given model elements in the mapping.
|
void |
clearAllocatedCaches()
Clear allocated caches.
|
void |
clearAllocatedCaches(Set<ModelElementId> modelElementIds)
Clear caches from the given set of
ModelElementIds. |
boolean |
contains(org.eclipse.emf.ecore.EObject modelElement)
Checks whether a given
EObject is contained in the collection. |
boolean |
contains(ModelElementId eObjectId)
Checks whether the
EObject with the given ESModelElementId is contained in the collection. |
void |
deleteModelElement(org.eclipse.emf.ecore.EObject modelElement)
Deletes the given model element from the collection.
|
void |
disallocateModelElementIds(Set<ModelElementId> modelElementIds)
Removes any allocated ID entries from this collection that are contained
in the given set of
ModelElementIds. |
Set<org.eclipse.emf.ecore.EObject> |
getAllModelElements()
Returns a flat representation of all model elements in the collection.
|
Map<org.eclipse.emf.ecore.EObject,String> |
getEObjectToIdMapping()
Returns the EObject/ID mapping where IDs are represented as strings.
|
Map<String,org.eclipse.emf.ecore.EObject> |
getIdToEObjectMapping()
Returns the ID/EObject mapping where IDs are represented as strings.
|
org.eclipse.emf.ecore.EObject |
getModelElement(ModelElementId modelElementId)
Returns the model element with the given
ESModelElementId. |
ModelElementId |
getModelElementId(org.eclipse.emf.ecore.EObject modelElement)
Retrieve the
ESModelElementId of the given model element. |
org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> |
getModelElements()
Returns all directly contained model element of the container, i.e.
|
<T extends org.eclipse.emf.ecore.EObject> |
getModelElementsByClass(org.eclipse.emf.ecore.EClass modelElementClass,
org.eclipse.emf.common.util.EList<T> list)
Retrieve a list of model elements of a certain type in the collection
that are directly contained in the collection.
|
void |
initMapping()
Initializes the ID caches of the collection, i.e.
|
void |
initMapping(Map<org.eclipse.emf.ecore.EObject,String> eObjectToIdMap,
Map<String,org.eclipse.emf.ecore.EObject> idToEObjectMap)
/**
Initializes the ID caches of the project with the given mappings.
|
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnseteAdapters, eDeliver, eNotify, eSetDelivergetAllModelElementsByClass, getAllModelElementsByClassgetcreateAPI, toAPIvoid addModelElement(org.eclipse.emf.ecore.EObject modelElement)
modelElement - the model element that should be added to the collectionvoid clearAllocatedCaches()
void clearAllocatedCaches(Set<ModelElementId> modelElementIds)
ModelElementIds.modelElementIds - the collection of ModelElementIds to be removed from the allocated cachevoid allocateModelElementIds(Map<org.eclipse.emf.ecore.EObject,ModelElementId> modelElementToIdMap)
EObject contained in the mapping is added to this collection
its ModelElementId will be determined using the ID in the mapping.modelElementToIdMap - A map containing ModelElementIds for the model element
and its childrenvoid disallocateModelElementIds(Set<ModelElementId> modelElementIds)
ModelElementIds.modelElementIds - the set of model element IDs to be releasedboolean contains(org.eclipse.emf.ecore.EObject modelElement)
EObject is contained in the collection.contains in interface ESObjectContainer<ModelElementId>modelElement - the model element to be checked, whether it is contained in the
collectiontrue, if the model element is contained in the collection, false otherwiseESObjectContainer.contains(org.eclipse.emf.ecore.EObject)boolean contains(ModelElementId eObjectId)
EObject with the given ESModelElementId is contained in the collection.contains in interface ESObjectContainer<ModelElementId>eObjectId - the model element ID of the EObject, which needs to be checked,
whether it is contained in the collectiontrue, if the EObject with the given model element ID is
contained in the collection, falseESObjectContainer.contains(java.lang.Object)ModelElementId getModelElementId(org.eclipse.emf.ecore.EObject modelElement)
ESModelElementId of the given model element.getModelElementId in interface ESObjectContainer<ModelElementId>modelElement - the model element for which to retrieve the ID forESModelElementId of the given model elementESObjectContainer.getModelElementId(org.eclipse.emf.ecore.EObject)org.eclipse.emf.ecore.EObject getModelElement(ModelElementId modelElementId)
ESModelElementId.getModelElement in interface ESObjectContainer<ModelElementId>modelElementId - the ID of the model element, that should be retrievedESObjectContainer.getModelElement(java.lang.Object)org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> getModelElements()
getModelElements in interface ESObjectContainer<ModelElementId>ESObjectContainer.getModelElements()void deleteModelElement(org.eclipse.emf.ecore.EObject modelElement)
modelElement - the model element that should get deletedSet<org.eclipse.emf.ecore.EObject> getAllModelElements()
Returns a flat representation of all model elements in the collection.
The returned set is not modifiable and will throw an UnsupportedOperationException in case trying to do
so.
getAllModelElements in interface ESObjectContainer<ModelElementId>ESObjectContainer.getAllModelElements()<T extends org.eclipse.emf.ecore.EObject> org.eclipse.emf.common.util.EList<T> getModelElementsByClass(org.eclipse.emf.ecore.EClass modelElementClass,
org.eclipse.emf.common.util.EList<T> list)
T - a sub-type of model elementmodelElementClass - the EClasslist - a list of model elements, can be empty, but must be of the
same type as the modelElementClass indicates.void initMapping(Map<org.eclipse.emf.ecore.EObject,String> eObjectToIdMap, Map<String,org.eclipse.emf.ecore.EObject> idToEObjectMap)
eObjectToIdMap - a mapping from EObjects to IDsidToEObjectMap - the reverse mapping of eObjectToIdMapvoid initMapping()
getModelElements() and for each model
element the ModelElementId is fetched via getModelElementId(EObject). Then a
mapping
between the model element and its ModelElementId is created
within the cache.Map<String,org.eclipse.emf.ecore.EObject> getIdToEObjectMapping()
This method is mainly provided for convenience and performance reasons, where the ID must be a string.
Copyright © 2017. All rights reserved.