|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IdEObjectCollection
A collection of EObject
s where each one can be identified via a ModelElementId
. EObject
s can
be added and deleted and checked
whether they are part of the collection.
Method Summary | ||
---|---|---|
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. |
|
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 ModelElementId s. |
|
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 a copy of the EObject/ID mapping where IDs are represented as strings. |
|
Map<String,org.eclipse.emf.ecore.EObject> |
getIdToEObjectMapping()
Returns a copy of 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. |
|
|
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. |
Methods inherited from interface org.eclipse.emf.ecore.EObject |
---|
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset |
Methods inherited from interface org.eclipse.emf.common.notify.Notifier |
---|
eAdapters, eDeliver, eNotify, eSetDeliver |
Methods inherited from interface org.eclipse.emf.emfstore.common.model.ESObjectContainer |
---|
getAllModelElementsByClass, getAllModelElementsByClass |
Methods inherited from interface org.eclipse.emf.emfstore.common.model.ESIdToEObjectMapping |
---|
get |
Methods inherited from interface org.eclipse.emf.emfstore.internal.common.api.APIDelegate |
---|
createAPI, toAPI |
Method Detail |
---|
void addModelElement(org.eclipse.emf.ecore.EObject modelElement)
modelElement
- the model element that should be added to the collectionvoid clearAllocatedCaches()
void 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 ModelElementId
s for the model element
and its childrenvoid disallocateModelElementIds(Set<ModelElementId> modelElementIds)
ModelElementId
s.
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
collection
true
, 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 collection
true
, if the EObject with the given model element ID is
contained in the collection, false
ESObjectContainer.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 for
ESModelElementId
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 retrieved
ESObjectContainer.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 EClass
list
- 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 eObjectToIdMap
void 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()
Map<org.eclipse.emf.ecore.EObject,String> getEObjectToIdMapping()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |