org.eclipse.emf.emfstore.common.model
Interface ESObjectContainer<T>

Type Parameters:
T - the ID type being used
All Known Subinterfaces:
ESLocalProject, IdEObjectCollection, NotifiableIdEObjectCollection, Project
All Known Implementing Classes:
ESLocalProjectImpl, IdEObjectCollectionImpl, NotifiableIdEObjectCollectionImpl, ProjectImpl

public interface ESObjectContainer<T>

A container for EObjects where each EObject has a unique ESModelElementId assigned to it.

The container does not specify how model elements are added or removed from the underlying collection of EObjects.

Author:
emueller, wesendon

Method Summary
 boolean contains(org.eclipse.emf.ecore.EObject modelElement)
          Checks whether a given EObject is contained in the collection.
 boolean contains(T modelElementId)
          Checks whether the EObject with the given ESModelElementId is contained in the collection.
 Set<org.eclipse.emf.ecore.EObject> getAllModelElements()
           Returns a flat representation of all model elements in the collection.
<U extends org.eclipse.emf.ecore.EObject>
Set<U>
getAllModelElementsByClass(Class<U> modelElementClass)
          Retrieve a list of all model elements of a certain type in the collection.
<U extends org.eclipse.emf.ecore.EObject>
Set<U>
getAllModelElementsByClass(Class<U> modelElementClass, Boolean includeSubclasses)
          Retrieve a list of all model elements of a certain type in the collection.
 org.eclipse.emf.ecore.EObject getModelElement(T modelElementId)
          Returns the model element with the given ESModelElementId.
 T 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.
 

Method Detail

getModelElement

org.eclipse.emf.ecore.EObject getModelElement(T modelElementId)
Returns the model element with the given ESModelElementId.

Parameters:
modelElementId - the ID of the model element, that should be retrieved
Returns:
the model element that has the given ID assigned to it within the container

getModelElementId

T getModelElementId(org.eclipse.emf.ecore.EObject modelElement)
Retrieve the ESModelElementId of the given model element.

Parameters:
modelElement - the model element for which to retrieve the ID for
Returns:
the ESModelElementId of the given model element

getModelElements

org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> getModelElements()
Returns all directly contained model element of the container, i.e. a hierarchical representation of the model elements.

Returns:
a list containing the directly contained model elements within the container

getAllModelElements

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.

Returns:
a set of all model elements contained in the collection

contains

boolean contains(T modelElementId)
Checks whether the EObject with the given ESModelElementId is contained in the collection.

Parameters:
modelElementId - the model element ID of the EObject, which needs to be checked, whether it is contained in the collection
Returns:
true, if the EObject with the given model element ID is contained in the collection, false

contains

boolean contains(org.eclipse.emf.ecore.EObject modelElement)
Checks whether a given EObject is contained in the collection.

Parameters:
modelElement - the model element to be checked, whether it is contained in the collection
Returns:
true, if the model element is contained in the collection, false otherwise

getAllModelElementsByClass

<U extends org.eclipse.emf.ecore.EObject> Set<U> getAllModelElementsByClass(Class<U> modelElementClass,
                                                                            Boolean includeSubclasses)
Retrieve a list of all model elements of a certain type in the collection.

Type Parameters:
U - the type of the model element(s) to be retrieved
Parameters:
modelElementClass - the Class of the model element(s) to be retrieved
includeSubclasses - whether to also include all subclasses of the given Class in the list
Returns:
a list of model elements of the given type

getAllModelElementsByClass

<U extends org.eclipse.emf.ecore.EObject> Set<U> getAllModelElementsByClass(Class<U> modelElementClass)
Retrieve a list of all model elements of a certain type in the collection.

Type Parameters:
U - the type of the model element(s) to be retrieved
Parameters:
modelElementClass - the Class of the model element(s) to be retrieved
Returns:
a list of model elements of the given type


Copyright © 2015. All Rights Reserved.