Class ConstantValue

All Implemented Interfaces:
IAttributeAccess

public class ConstantValue extends Leaf
Class for a constant value.
Author:
jaehne, Holger Eichelberger
  • Field Details

    • constant

      private Value constant
  • Constructor Details

    • ConstantValue

      ConstantValue()
      Constructor for serialization.
    • ConstantValue

      public ConstantValue(Value constant)
      Sole constructor for the creation of a constant value.
      Parameters:
      constant - Constant value to be stored.
  • Method Details

    • inferDatatype

      public IDatatype inferDatatype()
      Description copied from class: ConstraintSyntaxTree
      Infers the datatype of the subtree represented by this object.
      Specified by:
      inferDatatype in class ConstraintSyntaxTree
      Returns:
      the data type
    • getConstantValue

      public Value getConstantValue()
      Getter-Method for the constant-value.
      Returns:
      the value of the constant-attribute.
    • accept

      public void accept(IConstraintTreeVisitor visitor)
      Description copied from class: ConstraintSyntaxTree
      Visiting method for the visitor.
      This method is used for saving this model element.
      Specified by:
      accept in class ConstraintSyntaxTree
      Parameters:
      visitor - The visitor, which should save this model element.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getContainedType

      public IDatatype getContainedType()
      Description copied from class: ConstraintSyntaxTree
      Returns the data type explicitly contained in this syntax tree. This is typically a constant value which contains a meta value, i.e. a type expression.
      Overrides:
      getContainedType in class ConstraintSyntaxTree
      Returns:
      the contained type or null if there is none
    • toString

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

      public static final boolean isNull(ConstraintSyntaxTree cst)
      Returns whether the given constraint is exactly the IVML null value.
      Parameters:
      cst - the constraint syntax tree
      Returns:
      true if cst is null, false else