public abstract class Model extends java.lang.Object implements IModel
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<ModelImport<?>> |
imports |
private java.lang.String |
name |
private Version |
version |
| Constructor and Description |
|---|
Model(java.lang.String name)
Creates a model instance.
|
Model(java.lang.String name,
Version version)
Creates a model instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addImport(ModelImport<?> pimport)
Adds an import to this model.
|
void |
dispose()
Shall be called at the end of the lifetime of the model in order
to clean up references such as listeners.
|
ModelImport<?> |
getImport(int index)
Returns the model import specified by
index. |
int |
getImportsCount()
Returns the number of imports.
|
java.lang.String |
getName()
Returns the name of the model element.
|
Version |
getVersion()
Returns the version of this model.
|
void |
setVersion(Version version)
Changes the version of this model.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetIndentationConfiguration, getRestrictionEvaluationContext, getSuperprivate Version version
private java.util.List<ModelImport<?>> imports
private java.lang.String name
public Model(java.lang.String name)
name - the name of the modelpublic Model(java.lang.String name,
Version version)
name - the name of the modelversion - the version of the model (may be null if there is none)public void setVersion(Version version)
setVersion in interface IModelversion - Version to setpublic Version getVersion()
getVersion in interface IModelgetVersion in interface IModelDatanull if no version is specified for this model.public java.lang.String getName()
getName in interface IModelgetName in interface IModelDatapublic boolean addImport(ModelImport<?> pimport)
pimport - The importtrue if the addition was successful,
false else due to duplicated namespublic int getImportsCount()
getImportsCount in interface IModelpublic ModelImport<?> getImport(int index)
index.getImport in interface IModelindex - a 0-based index specifying the import to be returnedjava.lang.IndexOutOfBoundsException - if
index<0 || index>=getImportsCount()Copyright © 2009 - 2018 SSE. All Rights Reserved.