Class CompositeModel
- java.lang.Object
-
- org.eclipse.epsilon.eol.models.Model
-
- org.eclipse.epsilon.emc.composite.CompositeModel
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<java.util.ArrayList<java.lang.Object>>
equivalents
protected java.util.Collection<IModel>
models
-
Fields inherited from class org.eclipse.epsilon.eol.models.Model
aliases, ENV_PREFIX, name, PROPERTY_ALIASES, PROPERTY_NAME, PROPERTY_READONLOAD, PROPERTY_READONLY, PROPERTY_STOREONDISPOSAL, propertyGetter, propertySetter, readOnLoad, storeOnDisposal
-
-
Constructor Summary
Constructors Constructor Description CompositeModel(java.lang.String name, java.util.Collection<IModel> models)
CompositeModel(java.util.Collection<IModel> models)
CompositeModel(java.util.Collection<IModel> models, MatchTrace matchTrace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<?>
allContents()
Returns a collection containing all of the objects contained in this model.java.lang.Object
createInstance(java.lang.String type)
void
deleteElement(java.lang.Object instance)
void
dispose()
protected void
findEquivalents(MatchTrace matchTrace)
java.util.Collection<java.lang.Object>
getAllOfKind(java.lang.String type)
java.util.Collection<java.lang.Object>
getAllOfType(java.lang.String type)
java.lang.Object
getElementById(java.lang.String id)
java.lang.String
getElementId(java.lang.Object instance)
java.lang.Object
getEnumerationValue(java.lang.String enumeration, java.lang.String label)
java.util.Collection<java.lang.Object>
getEquivalents(java.lang.Object instance)
IPropertySetter
getPropertySetter()
java.lang.String
getTypeNameOf(java.lang.Object instance)
Returns a string representing the type of the instance object.java.lang.Object
getTypeOf(java.lang.Object instance)
boolean
hasType(java.lang.String type)
boolean
isInstantiable(java.lang.String type)
boolean
isModelElement(java.lang.Object instance)
Used to test whether a Java object can be contained by this model.void
load()
boolean
owns(java.lang.Object instance)
Used to test whether an object is contained in this model.protected void
removeDuplicates(java.util.Collection<java.lang.Object> original)
void
removeDuplicates(java.util.Collection<java.lang.Object> original, java.util.Collection<java.lang.Object> equivalents)
void
setElementId(java.lang.Object instance, java.lang.String newId)
boolean
store()
boolean
store(java.lang.String location)
-
Methods inherited from class org.eclipse.epsilon.eol.models.Model
allInstances, createInstance, getAliases, getFullyQualifiedTypeNameOf, getMetamodel, getName, getPropertyGetter, getTransactionSupport, isOfKind, isOfType, isPropertySet, isReadOnLoad, isStoredOnDisposal, knowsAboutProperty, load, load, load, setName, setReadOnLoad, setStoredOnDisposal
-
-
-
-
Field Detail
-
models
protected java.util.Collection<IModel> models
-
equivalents
protected java.util.ArrayList<java.util.ArrayList<java.lang.Object>> equivalents
-
-
Constructor Detail
-
CompositeModel
public CompositeModel(java.util.Collection<IModel> models)
-
CompositeModel
public CompositeModel(java.lang.String name, java.util.Collection<IModel> models)
-
CompositeModel
public CompositeModel(java.util.Collection<IModel> models, MatchTrace matchTrace)
-
-
Method Detail
-
findEquivalents
protected void findEquivalents(MatchTrace matchTrace)
-
getEquivalents
public java.util.Collection<java.lang.Object> getEquivalents(java.lang.Object instance)
-
removeDuplicates
public void removeDuplicates(java.util.Collection<java.lang.Object> original, java.util.Collection<java.lang.Object> equivalents)
-
removeDuplicates
protected void removeDuplicates(java.util.Collection<java.lang.Object> original)
-
allContents
public java.util.Collection<?> allContents()
Description copied from interface:IModel
Returns a collection containing all of the objects contained in this model.- Returns:
- all of the objects contained in this model.
-
createInstance
public java.lang.Object createInstance(java.lang.String type) throws EolModelElementTypeNotFoundException, EolNotInstantiableModelElementTypeException
-
deleteElement
public void deleteElement(java.lang.Object instance) throws EolRuntimeException
- Throws:
EolRuntimeException
-
getAllOfKind
public java.util.Collection<java.lang.Object> getAllOfKind(java.lang.String type) throws EolModelElementTypeNotFoundException
-
getAllOfType
public java.util.Collection<java.lang.Object> getAllOfType(java.lang.String type) throws EolModelElementTypeNotFoundException
-
getElementById
public java.lang.Object getElementById(java.lang.String id)
-
getElementId
public java.lang.String getElementId(java.lang.Object instance)
-
setElementId
public void setElementId(java.lang.Object instance, java.lang.String newId)
-
getEnumerationValue
public java.lang.Object getEnumerationValue(java.lang.String enumeration, java.lang.String label) throws EolEnumerationValueNotFoundException
-
getTypeOf
public java.lang.Object getTypeOf(java.lang.Object instance)
-
getTypeNameOf
public java.lang.String getTypeNameOf(java.lang.Object instance)
Description copied from interface:IModel
Returns a string representing the type of the instance object. The value returned by this function can be passed to createInstance to instantiate another object of the same type as instance.- Parameters:
instance
- The model object whose type is to be determined.- Returns:
- the name of the type of the model object, instance.
-
hasType
public boolean hasType(java.lang.String type)
-
isInstantiable
public boolean isInstantiable(java.lang.String type)
-
isModelElement
public boolean isModelElement(java.lang.Object instance)
Description copied from interface:IModel
Used to test whether a Java object can be contained by this model. For example, EMF models can contain instances of EObject, but not instances of just Object.- Specified by:
isModelElement
in interfaceIModel
- Overrides:
isModelElement
in classModel
- Parameters:
instance
- the Java object to test.- Returns:
- true if and only if instance can be contained by this model.
-
load
public void load() throws EolModelLoadingException
- Throws:
EolModelLoadingException
-
owns
public boolean owns(java.lang.Object instance)
Description copied from interface:IModel
Used to test whether an object is contained in this model.- Parameters:
instance
- the Java object to test.- Returns:
- true if and only if instance is contained by this model.
-
dispose
public void dispose()
-
store
public boolean store(java.lang.String location)
-
store
public boolean store()
-
getPropertySetter
public IPropertySetter getPropertySetter()
- Specified by:
getPropertySetter
in interfaceIModel
- Overrides:
getPropertySetter
in classModel
-
-