Package net.ssehub.easy.varModel.cst
Class ConstantValue
- java.lang.Object
-
- net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
-
- net.ssehub.easy.varModel.cst.Leaf
-
- net.ssehub.easy.varModel.cst.ConstantValue
-
- All Implemented Interfaces:
IAttributeAccess
public class ConstantValue extends Leaf
Class for a constant value.- Author:
- jaehne, Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description ConstantValue()Constructor for serialization.ConstantValue(Value constant)Sole constructor for the creation of a constant value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IConstraintTreeVisitor visitor)Visiting method for the visitor.booleanequals(java.lang.Object obj)ValuegetConstantValue()Getter-Method for the constant-value.IDatatypegetContainedType()Returns the data type explicitly contained in this syntax tree.inthashCode()IDatatypeinferDatatype()Infers the datatype of the subtree represented by this object.static booleanisNull(ConstraintSyntaxTree cst)Returns whether the given constraint is exactly the IVML null value.java.lang.StringtoString()-
Methods inherited from class net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
getAttribute, getAttribute, getAttributesCount, getName, getParent, isSemanticallyEqual
-
-
-
-
Field Detail
-
constant
private Value constant
-
-
Constructor Detail
-
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 Detail
-
inferDatatype
public IDatatype inferDatatype()
Description copied from class:ConstraintSyntaxTreeInfers the datatype of the subtree represented by this object.- Specified by:
inferDatatypein classConstraintSyntaxTree- 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:ConstraintSyntaxTreeVisiting method for the visitor.
This method is used for saving this model element.- Specified by:
acceptin classConstraintSyntaxTree- Parameters:
visitor- The visitor, which should save this model element.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getContainedType
public IDatatype getContainedType()
Description copied from class:ConstraintSyntaxTreeReturns 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:
getContainedTypein classConstraintSyntaxTree- Returns:
- the contained type or null if there is none
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.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:
trueifcstis null,falseelse
-
-