public abstract class IdEObjectCollectionImpl extends org.eclipse.emf.ecore.impl.EObjectImpl implements IdEObjectCollection, ESDisposable
EObjects.org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList| Modifier and Type | Field and Description |
|---|---|
static String |
MATERIALIZED_MODELELEMENTID_GENERATOR_EXTENSIONPOINT
The extension point id to configure the
ESModelElementIdGenerator. |
static String |
MODELELEMENTID_GENERATOR_CLASS_ATTRIBUTE
The attribute identifying the class of the
ESModelElementIdGenerator extension point. |
static String |
MODELELEMENTID_GENERATOR_EXTENSIONPOINT
The extension point id to configure the
ESModelElementIdGenerator. |
| Constructor and Description |
|---|
IdEObjectCollectionImpl()
Constructor.
|
IdEObjectCollectionImpl(org.eclipse.emf.ecore.xmi.XMIResource xmiResource)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addModelElement(org.eclipse.emf.ecore.EObject eObject)
Adds the given model element to the collection.
|
void |
allocateModelElementIds(Map<org.eclipse.emf.ecore.EObject,ModelElementId> eObjectToIdMapping)
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 id)
Checks whether the
EObject with the given ESModelElementId is contained in the collection. |
<T extends IdEObjectCollection> |
copy()
Copies 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. |
void |
dispose()
Marker method for classes that need to perform clean-up tasks.
|
org.eclipse.emf.ecore.EObject |
get(ModelElementId modelElementId)
Get the
EObject for the given ESModelElementId, if any. |
Set<org.eclipse.emf.ecore.EObject> |
getAllModelElements()
Returns a flat representation of all model elements in the collection.
|
<T extends org.eclipse.emf.ecore.EObject> |
getAllModelElementsByClass(Class<T> modelElementClass)
Retrieve a list of all model elements of a certain type in the collection.
|
<T extends org.eclipse.emf.ecore.EObject> |
getAllModelElementsByClass(Class<T> modelElementClass,
Boolean includeSubclasses)
Retrieve a list of all model elements of a certain type in the collection.
|
<T extends org.eclipse.emf.ecore.EObject> |
getAllModelElementsByClass(org.eclipse.emf.ecore.EClass modelElementClass,
org.eclipse.emf.common.util.EList<T> list)
Gets all model elements by class.
|
<T extends org.eclipse.emf.ecore.EObject> |
getAllModelElementsByClass(org.eclipse.emf.ecore.EClass modelElementClass,
org.eclipse.emf.common.util.EList<T> list,
Boolean subclasses)
Gets all model elements by class.
|
org.eclipse.emf.ecore.EObject |
getDeletedModelElement(ModelElementId deletedModelElementId)
Returns the deleted model element by means of an ID.
|
ModelElementId |
getDeletedModelElementId(org.eclipse.emf.ecore.EObject deletedModelElement)
Returns the ID of a deleted model element.
|
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 eObject)
Retrieve the
ESModelElementId of the given model element. |
abstract 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)
Gets all model elements by class.
|
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.
|
void |
removeModelElement(org.eclipse.emf.ecore.EObject modelElement)
Removes a model element.
|
void |
removeModelElementAndChildrenFromResource(org.eclipse.emf.ecore.EObject eObject)
Removes the the given
EObject and all its contained children from
their respective XMIResources. |
eAdapters, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eSetClass, eSetDeliver, eSetProxyURIeAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInverseRemove, eInvoke, eIsSet, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eResolveProxy, eResource, eSet, eSet, eSetResource, eSetStore, eSetting, eStore, eUnset, eUnset, eURIFragmentSegment, eVirtualGet, eVirtualGet, eVirtualIsSet, eVirtualSet, eVirtualUnset, toStringeNotificationRequired, eNotifyequals, getClass, hashCode, notify, notifyAll, wait, wait, waiteAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnseteAdapters, eDeliver, eNotify, eSetDelivercreateAPI, toAPIpublic static final String MODELELEMENTID_GENERATOR_EXTENSIONPOINT
ESModelElementIdGenerator.public static final String MATERIALIZED_MODELELEMENTID_GENERATOR_EXTENSIONPOINT
ESModelElementIdGenerator.public static final String MODELELEMENTID_GENERATOR_CLASS_ATTRIBUTE
ESModelElementIdGenerator extension point.public IdEObjectCollectionImpl()
public IdEObjectCollectionImpl(org.eclipse.emf.ecore.xmi.XMIResource xmiResource)
throws IOException
XMIResource as model
elements to the collection. If the XMIResource also has XMI IDs
assigned to the EObjects it contains, they will be used for
creating the ModelElementIds within the project, if not, the ModelElementIds will get created on
the fly.xmiResource - a XMIResourceIOException - if the given XMIResource could not be loadedpublic abstract org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> getModelElements()
getModelElements in interface ESObjectContainer<ModelElementId>getModelElements in interface IdEObjectCollectionIdEObjectCollection.getModelElements()public void addModelElement(org.eclipse.emf.ecore.EObject eObject)
addModelElement in interface IdEObjectCollectioneObject - the model element that should be added to the collectionIdEObjectCollection.addModelElement(org.eclipse.emf.ecore.EObject)public boolean contains(org.eclipse.emf.ecore.EObject modelElement)
EObject is contained in the collection.contains in interface ESObjectContainer<ModelElementId>contains in interface IdEObjectCollectionmodelElement - the model element to be checked, whether it is contained in the
collectiontrue, if the model element is contained in the collection, false otherwiseIdEObjectCollection.contains(org.eclipse.emf.ecore.EObject)public boolean contains(ModelElementId id)
EObject with the given ESModelElementId is contained in the collection.contains in interface ESObjectContainer<ModelElementId>contains in interface IdEObjectCollectionid - 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, falseIdEObjectCollection.contains(org.eclipse.emf.emfstore.internal.common.model.ModelElementId)public ModelElementId getDeletedModelElementId(org.eclipse.emf.ecore.EObject deletedModelElement)
deletedModelElement - the model element that has been deletednull if no such ID existspublic org.eclipse.emf.ecore.EObject getDeletedModelElement(ModelElementId deletedModelElementId)
deletedModelElementId - the ID of an already deleted model elementnull if no such element existspublic ModelElementId getModelElementId(org.eclipse.emf.ecore.EObject eObject)
ESModelElementId of the given model element.getModelElementId in interface ESObjectContainer<ModelElementId>getModelElementId in interface IdEObjectCollectioneObject - the model element for which to retrieve the ID forESModelElementId of the given model elementIdEObjectCollection.getModelElementId(org.eclipse.emf.ecore.EObject)public org.eclipse.emf.ecore.EObject getModelElement(ModelElementId modelElementId)
ESModelElementId.getModelElement in interface ESObjectContainer<ModelElementId>getModelElement in interface IdEObjectCollectionmodelElementId - the ID of the model element, that should be retrievedIdEObjectCollection.getModelElement(org.eclipse.emf.emfstore.internal.common.model.ModelElementId)public void deleteModelElement(org.eclipse.emf.ecore.EObject modelElement)
deleteModelElement in interface IdEObjectCollectionmodelElement - the model element that should get deletedIdEObjectCollection.deleteModelElement(org.eclipse.emf.ecore.EObject)public void removeModelElementAndChildrenFromResource(org.eclipse.emf.ecore.EObject eObject)
EObject and all its contained children from
their respective XMIResources.eObject - the EObject to removepublic Set<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>getAllModelElements in interface IdEObjectCollectionIdEObjectCollection.getAllModelElements()public <T extends org.eclipse.emf.ecore.EObject> org.eclipse.emf.common.util.EList<T> getAllModelElementsByClass(org.eclipse.emf.ecore.EClass modelElementClass,
org.eclipse.emf.common.util.EList<T> list)
T - typemodelElementClass - the EClasslist - the list of model elementspublic <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)
getModelElementsByClass in interface IdEObjectCollectionT - typemodelElementClass - the EClasslist - the list of model elementspublic <T extends org.eclipse.emf.ecore.EObject> org.eclipse.emf.common.util.EList<T> getAllModelElementsByClass(org.eclipse.emf.ecore.EClass modelElementClass,
org.eclipse.emf.common.util.EList<T> list,
Boolean subclasses)
T - typemodelElementClass - the EClasslist - the list of model elementssubclasses - whether to use subclassespublic <T extends org.eclipse.emf.ecore.EObject> Set<T> getAllModelElementsByClass(Class<T> modelElementClass)
getAllModelElementsByClass in interface ESObjectContainer<ModelElementId>T - the type of the model element(s) to be retrievedmodelElementClass - the Class of the model element(s) to be retrievedESObjectContainer.getAllModelElementsByClass(java.lang.Class)public <T extends org.eclipse.emf.ecore.EObject> Set<T> getAllModelElementsByClass(Class<T> modelElementClass, Boolean includeSubclasses)
getAllModelElementsByClass in interface ESObjectContainer<ModelElementId>T - the type of the model element(s) to be retrievedmodelElementClass - the Class of the model element(s) to be retrievedincludeSubclasses - whether to also include all subclasses of the given Class in the listESObjectContainer.getAllModelElementsByClass(java.lang.Class,
java.lang.Boolean)public void initMapping()
IdEObjectCollection.getModelElements() and for each model
element the ModelElementId is fetched via IdEObjectCollection.getModelElementId(EObject). Then a
mapping
between the model element and its ModelElementId is created
within the cache.initMapping in interface IdEObjectCollectionIdEObjectCollection.initMapping()public void initMapping(Map<org.eclipse.emf.ecore.EObject,String> eObjectToIdMap, Map<String,org.eclipse.emf.ecore.EObject> idToEObjectMap)
initMapping in interface IdEObjectCollectioneObjectToIdMap - a mapping from EObjects to IDsidToEObjectMap - the reverse mapping of eObjectToIdMapIdEObjectCollection.initMapping(java.util.Map, java.util.Map)public <T extends IdEObjectCollection> T copy()
T - a collection typepublic void dispose()
dispose in interface ESDisposableESDisposable.dispose()public void allocateModelElementIds(Map<org.eclipse.emf.ecore.EObject,ModelElementId> eObjectToIdMapping)
EObject contained in the mapping is added to this collection
its ModelElementId will be determined using the ID in the mapping.allocateModelElementIds in interface IdEObjectCollectioneObjectToIdMapping - A map containing ModelElementIds for the model element
and its childrenIdEObjectCollection.allocateModelElementIds(java.util.Map)public void disallocateModelElementIds(Set<ModelElementId> modelElementIds)
ModelElementIds.disallocateModelElementIds in interface IdEObjectCollectionmodelElementIds - the set of model element IDs to be releasedIdEObjectCollection.disallocateModelElementIds(java.util.Set)public void clearAllocatedCaches()
clearAllocatedCaches in interface IdEObjectCollectionIdEObjectCollection.clearAllocatedCaches()public void clearAllocatedCaches(Set<ModelElementId> modelElementIds)
ModelElementIds.clearAllocatedCaches in interface IdEObjectCollectionmodelElementIds - the collection of ModelElementIds to be removed from the allocated cacheIdEObjectCollection.clearAllocatedCaches(java.util.Set)public org.eclipse.emf.ecore.EObject get(ModelElementId modelElementId)
EObject for the given ESModelElementId, if any.get in interface ESIdToEObjectMapping<ModelElementId>modelElementId - the IDESIdToEObjectMapping.get(java.lang.Object)public 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.
getIdToEObjectMapping in interface IdEObjectCollectionIdEObjectCollection.getIdToEObjectMapping()public Map<org.eclipse.emf.ecore.EObject,String> getEObjectToIdMapping()
This method is mainly provided for convenience and performance reasons, where the ID must be a string.
getEObjectToIdMapping in interface IdEObjectCollectionIdEObjectCollection.getEObjectToIdMapping()public void removeModelElement(org.eclipse.emf.ecore.EObject modelElement)
modelElement - the element to removeCopyright © 2017. All rights reserved.