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

public abstract class ContainableModelElement extends ModelElement implements IDatatypeVisitable
Represents the objects, a project can handle.
Author:
Marcel Lueder, Holger Eichelberger
  • Field Details

  • Constructor Details

    • ContainableModelElement

      protected ContainableModelElement(String name, IModelElement parent)
      Constructor for containable model element.
      Parameters:
      name - Name of the containable model element
      parent - the object, in which this specific one is embedded
  • Method Details

    • getParent

      public final IModelElement getParent()
      Description copied from interface: IModelElement
      Returns the parent model element.
      Specified by:
      getParent in interface IModelElement
      Overrides:
      getParent in class ModelElement
      Returns:
      the parent model element (may be null)
    • getTopLevelParent

      public final IModelElement getTopLevelParent()
      Returns the topLevel parent.
      Returns:
      should be the project
    • getProject

      public final 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

      public String getNameSpace()
      Description copied from interface: IModelElement
      Returns the namespace introduced by this model element.
      Specified by:
      getNameSpace in interface IModelElement
      Overrides:
      getNameSpace in class ModelElement
      Returns:
      the namespace introduced by this model element.
    • getQualifiedName

      public String getQualifiedName()
      Description copied from interface: IModelElement
      Returns the qualified name of this element.
      Specified by:
      getQualifiedName in interface IModelElement
      Overrides:
      getQualifiedName in class ModelElement
      Returns:
      the qualified name
    • setParent

      public final void setParent(IModelElement parent)
      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

      public void accept(IDatatypeVisitor visitor)
      Description copied from interface: IDatatypeVisitable
      Accepts a specialized visitor for creating a textual representation of the identity of this type.
      Specified by:
      accept in interface IDatatypeVisitable
      Parameters:
      visitor - the visitor to accept