Class ModelElement

java.lang.Object
net.ssehub.easy.varModel.model.ModelElement
All Implemented Interfaces:
IModelElement
Direct Known Subclasses:
BasicDecisionVariableContainer, ContainableModelElement, EnumLiteral, Project

public abstract class ModelElement extends Object implements IModelElement
All elements a VarModel could contain.
Author:
Marcel Lueder
  • Field Details

    • name

      private String name
    • comment

      private String comment
    • isUnique

      private boolean isUnique
  • Constructor Details

    • ModelElement

      protected ModelElement(String name)
      Constructor for the model element.
      Parameters:
      name - Name of the model element
  • Method Details

    • getName

      public final String getName()
      Description copied from interface: IModelElement
      Returns the name of the model element.
      Specified by:
      getName in interface IModelElement
      Returns:
      Name of this model element.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getComment

      public final String getComment()
      Description copied from interface: IModelElement
      Returns the comment of the model element.
      Specified by:
      getComment in interface IModelElement
      Returns:
      Comment of this model element.
      See Also:
    • setComment

      public void setComment(String comment)
      Description copied from interface: IModelElement
      Changes the (possibly internationalized) comment of this model element. Please note that comments are not stored in the model rather than in additional resource files associated to the model. Use #storeComments(de.uni_hildesheim.sse.model.management.ProjectInfo) for storing comments. Loading of comments is done as part of loading models.
      Specified by:
      setComment in interface IModelElement
      Parameters:
      comment - the new comment, turned into an empty string if null
    • getNameSpace

      public String getNameSpace()
      Description copied from interface: IModelElement
      Returns the namespace introduced by this model element.
      Specified by:
      getNameSpace in interface IModelElement
      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
      Returns:
      the qualified name
    • getUniqueName

      public final String getUniqueName()
      Description copied from interface: IModelElement
      Returns the UniqueName of this model element.
      Specified by:
      getUniqueName in interface IModelElement
      Returns:
      the unique name of this model element
    • setName

      protected void setName(String name)
      Changes the name of this model element.
      Parameters:
      name - the new name
    • findAttribute

      public static final Attribute findAttribute(IAttributeAccess access, String name)
      Searches for a specified attribute.
      Parameters:
      access - the instance providing access to attributes
      name - the name of the attribute to search for
      Returns:
      the attribute or null if not found
    • propagateAttribute

      public boolean propagateAttribute(Attribute attribute)
      Description copied from interface: IModelElement
      Propagates an attribute application from the parent to this element or contained elements. This may imply the creation of clones of the given attribute.
      Specified by:
      propagateAttribute in interface IModelElement
      Parameters:
      attribute - the attribute to be propagated
      Returns:
      true if the operation was successful, false if the element is about being attributed multiple times with the same attribute
    • isTransparent

      public boolean isTransparent()
      Description copied from interface: IModelElement
      Returns whether this element is transparent regarding the naming hierarchy.
      Specified by:
      isTransparent in interface IModelElement
      Returns:
      true if it is transparent, false else
    • getParent

      public IModelElement getParent()
      Description copied from interface: IModelElement
      Returns the parent model element.
      Specified by:
      getParent in interface IModelElement
      Returns:
      the parent model element (may be null)