org.infai.emo.matcher.util
Class Model
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractSet<E>
java.util.HashSet<org.eclipse.emf.ecore.EObject>
org.infai.emo.matcher.util.Model
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<org.eclipse.emf.ecore.EObject>, java.util.Collection<org.eclipse.emf.ecore.EObject>, java.util.Set<org.eclipse.emf.ecore.EObject>
public class Model
- extends java.util.HashSet<org.eclipse.emf.ecore.EObject>
This is a cached model containing all its elements.
Class is a HashSet
containing EObjects.
- Version:
- 1.0.0
- Author:
- Stanley Hillner
- See Also:
EObject
,
Serialized Form
Field Summary |
private org.eclipse.emf.ecore.resource.Resource |
modelResource
The resource created from the model file into which the model was loaded. |
Constructor Summary |
private |
Model()
The constructor for an empty model. |
|
Model(org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> list)
The constructor that builds the model into the cache out of an EList. |
|
Model(org.eclipse.emf.ecore.resource.Resource modelResource)
The constructor that reflect the model into the cache by rebuilding it from the resource the model was loaded into. |
Method Summary |
org.eclipse.emf.ecore.resource.Resource |
getModelResource()
|
int |
getPosition(org.eclipse.emf.ecore.EObject element)
Returns the position oft the given element in the model-tree. |
java.lang.String |
toString()
|
Methods inherited from class java.util.HashSet |
add, clear, clone, contains, isEmpty, iterator, remove, size |
Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
modelResource
private org.eclipse.emf.ecore.resource.Resource modelResource
- The resource created from the model file into which the model was loaded.
- See Also:
Resource
Model
private Model()
- The constructor for an empty model.
Model
public Model(org.eclipse.emf.ecore.resource.Resource modelResource)
- The constructor that reflect the model into the cache by rebuilding it from the resource the model was loaded into.
- Parameters:
modelResource
- the resource into which the model was loaded.- See Also:
modelResource
Model
public Model(org.eclipse.emf.common.util.EList<org.eclipse.emf.ecore.EObject> list)
- The constructor that builds the model into the cache out of an EList.
The EList has to contain the tree structure of the model for a correctly built model.
- Parameters:
list
- the list that contains the model-elements.- See Also:
EList
toString
public java.lang.String toString()
-
- Overrides:
toString
in class java.util.AbstractCollection<org.eclipse.emf.ecore.EObject>
getModelResource
public org.eclipse.emf.ecore.resource.Resource getModelResource()
- Returns:
- the resource out of which the model was build.
- See Also:
modelResource
getPosition
public int getPosition(org.eclipse.emf.ecore.EObject element)
- Returns the position oft the given element in the model-tree.
- Parameters:
element
- the element whose position is sought.
- Returns:
- an integer-value that represents the position of the element.