Package net.ssehub.easy.varModel.model
Class ContainableModelElement
java.lang.Object
net.ssehub.easy.varModel.model.ModelElement
net.ssehub.easy.varModel.model.ContainableModelElement
- All Implemented Interfaces:
IDatatypeVisitable,IModelElement
- Direct Known Subclasses:
AbstractVariable,AttributeAssignment,Comment,CompoundAccessStatement,Constraint,CustomDatatype,EvaluationBlock,OperationDefinition,ProjectInterface
Represents the objects, a project can handle.
- Author:
- Marcel Lueder, Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContainableModelElement(String name, IModelElement parent) Constructor for containable model element. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IDatatypeVisitor visitor) Accepts a specialized visitor for creating a textual representation of the identity of this type.Returns the namespace introduced by this model element.final IModelElementReturns the parent model element.final ProjectReturns the containing project.Returns the qualified name of this element.final IModelElementReturns the topLevel parent.final booleanMethod to check whether the parent is a topLevel-element.final voidsetParent(IModelElement parent) Changes the parent object.Methods inherited from class net.ssehub.easy.varModel.model.ModelElement
findAttribute, getComment, getName, getUniqueName, isTransparent, propagateAttribute, setComment, setName, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.ssehub.easy.varModel.model.IModelElement
accept
-
Field Details
-
parent
-
namespace
-
-
Constructor Details
-
ContainableModelElement
Constructor for containable model element.- Parameters:
name- Name of the containable model elementparent- the object, in which this specific one is embedded
-
-
Method Details
-
getParent
Description copied from interface:IModelElementReturns the parent model element.- Specified by:
getParentin interfaceIModelElement- Overrides:
getParentin classModelElement- Returns:
- the parent model element (may be null)
-
getTopLevelParent
Returns the topLevel parent.- Returns:
- should be the project
-
getProject
Returns the containing project.- Returns:
- the contaning project (may be null if there is none)
-
isTopLevel
public final boolean isTopLevel()Method to check whether the parent is a topLevel-element.- Returns:
- true, if the parent is the project, otherwise false
-
getNameSpace
Description copied from interface:IModelElementReturns the namespace introduced by this model element.- Specified by:
getNameSpacein interfaceIModelElement- Overrides:
getNameSpacein classModelElement- Returns:
- the namespace introduced by this model element.
-
getQualifiedName
Description copied from interface:IModelElementReturns the qualified name of this element.- Specified by:
getQualifiedNamein interfaceIModelElement- Overrides:
getQualifiedNamein classModelElement- Returns:
- the qualified name
-
setParent
Changes the parent object. Note, that this operation is necessary (although not intended) to resolve some of the cycles in creating compounds or temporary variables.- Parameters:
parent- the parent element
-
accept
Description copied from interface:IDatatypeVisitableAccepts a specialized visitor for creating a textual representation of the identity of this type.- Specified by:
acceptin interfaceIDatatypeVisitable- Parameters:
visitor- the visitor to accept
-