|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.ecore.impl.BasicEObjectImpl
org.eclipse.emf.ecore.impl.EObjectImpl
org.eclipse.emf.emfstore.internal.common.model.impl.IdEObjectCollectionImpl
public abstract class IdEObjectCollectionImpl
Implementation of an ID based storage mechanism for EObjects.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
|---|
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 |
| Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject |
|---|
org.eclipse.emf.ecore.InternalEObject.EStore |
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl |
|---|
ELAST_EOBJECT_FLAG |
| Fields inherited from interface org.eclipse.emf.ecore.InternalEObject |
|---|
EOPPOSITE_FEATURE_BASE |
| Constructor Summary | |
|---|---|
IdEObjectCollectionImpl()
Constructor. |
|
IdEObjectCollectionImpl(org.eclipse.emf.ecore.xmi.XMIResource xmiResource)
Constructor. |
|
| Method Summary | ||
|---|---|---|
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. |
|
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. |
|
|
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. |
|
|
getAllModelElementsByClass(Class<T> modelElementClass)
Retrieve a list of all model elements of a certain type in the collection. |
|
|
getAllModelElementsByClass(Class<T> modelElementClass,
Boolean includeSubclasses)
Retrieve a list of all model elements of a certain type in the collection. |
|
|
getAllModelElementsByClass(org.eclipse.emf.ecore.EClass modelElementClass,
org.eclipse.emf.common.util.EList<T> list)
Gets all model elements by class. |
|
|
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. |
|
String |
getEObjectId(org.eclipse.emf.ecore.EObject eObject)
Returns the EObject Id. |
|
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 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. |
|
|
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. |
|
| Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl |
|---|
eAdapters, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eSetClass, eSetDeliver, eSetProxyURI |
| Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl |
|---|
eAllContents, 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, toString |
| Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl |
|---|
eNotificationRequired, eNotify |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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.internal.common.api.APIDelegate |
|---|
createAPI, toAPI |
| Methods inherited from interface org.eclipse.emf.ecore.InternalEObject |
|---|
eNotificationRequired |
| Field Detail |
|---|
public static final String MODELELEMENTID_GENERATOR_EXTENSIONPOINT
ESModelElementIdGenerator.
public static final String MODELELEMENTID_GENERATOR_CLASS_ATTRIBUTE
ESModelElementIdGenerator extension point.
| Constructor Detail |
|---|
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 XMIResource
IOException - if the given XMIResource could not be loaded| Method Detail |
|---|
public 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
collection
true, 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 collection
true, 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 deleted
null if no such ID existspublic org.eclipse.emf.ecore.EObject getDeletedModelElement(ModelElementId deletedModelElementId)
deletedModelElementId - the ID of an already deleted model element
null 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 for
ESModelElementId 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 retrieved
IdEObjectCollection.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 elements
public <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 elements
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,
Boolean subclasses)
T - typemodelElementClass - the EClasslist - the list of model elementssubclasses - whether to use subclasses
public <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 retrieved
ESObjectContainer.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 list
ESObjectContainer.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 type
public 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 String getEObjectId(org.eclipse.emf.ecore.EObject eObject)
eObject - the eobject
public org.eclipse.emf.ecore.EObject get(ModelElementId modelElementId)
EObject for the given ESModelElementId, if any.
get in interface ESIdToEObjectMapping<ModelElementId>modelElementId - the ID
ESIdToEObjectMapping.get(java.lang.Object)public Map<String,org.eclipse.emf.ecore.EObject> getIdToEObjectMapping()
getIdToEObjectMapping in interface IdEObjectCollectionIdEObjectCollection.getIdToEObjectMapping()public Map<org.eclipse.emf.ecore.EObject,String> getEObjectToIdMapping()
getEObjectToIdMapping in interface IdEObjectCollectionIdEObjectCollection.getEObjectToIdMapping()public void removeModelElement(org.eclipse.emf.ecore.EObject modelElement)
modelElement - the element to remove
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||