Package net.ssehub.easy.varModel.cst
Class Variable
java.lang.Object
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
net.ssehub.easy.varModel.cst.Leaf
net.ssehub.easy.varModel.cst.Variable
- All Implemented Interfaces:
IAttributeAccess
- Direct Known Subclasses:
AttributeVariable,ResolvedVariable
Class for a variable value.
- Author:
- jaehne, Holger Eichelberger
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVariable()Constructor for serialization.Variable(AbstractVariable nestedVariable) The constructor for this class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IConstraintTreeVisitor visitor) Visiting method for the visitor.booleangetAttribute(int index) Returns a specific attribute.intReturns the number of attributes.Returns the qualifier for accessing the variable, e.g., an expression to be put before.Returns the resolved decision variable.Getter for the nestedVariable.inthashCode()Infers the datatype of the subtree represented by this object.booleanisSemanticallyEqual(ConstraintSyntaxTree otherTree) Checks whether thisConstraintSyntaxTreeis semantically equal to anotherConstraintSyntaxTree.toString()Methods inherited from class net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
getAttribute, getContainedType, getName, getParent
-
Field Details
-
nestedVariable
-
-
Constructor Details
-
Variable
Variable()Constructor for serialization. -
Variable
The constructor for this class.- Parameters:
nestedVariable- The nested variable should be embedded in the current constraint.
-
-
Method Details
-
getVariable
Getter for the nestedVariable.- Returns:
- The nested variable should not be null.
-
inferDatatype
Description copied from class:ConstraintSyntaxTreeInfers the datatype of the subtree represented by this object.- Specified by:
inferDatatypein classConstraintSyntaxTree- Returns:
- the data type
- Throws:
CSTSemanticException- Will be thrown if parameters of (sub-) trees do not fit together.
-
accept
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
-
hashCode
public int hashCode() -
getAttributesCount
public int getAttributesCount()Description copied from class:ConstraintSyntaxTreeReturns the number of attributes.- Specified by:
getAttributesCountin interfaceIAttributeAccess- Overrides:
getAttributesCountin classConstraintSyntaxTree- Returns:
- the number of attributes
-
getAttribute
Description copied from class:ConstraintSyntaxTreeReturns a specific attribute.- Specified by:
getAttributein interfaceIAttributeAccess- Overrides:
getAttributein classConstraintSyntaxTree- Parameters:
index- the index of the attribute- Returns:
- the attribute
-
toString
-
getQualifier
Returns the qualifier for accessing the variable, e.g., an expression to be put before. For usual variables, the qualifier is always null.- Returns:
- the qualifier (may be null)
-
getResolved
Returns the resolved decision variable.- Returns:
- the decision variable (may be null)
-
isSemanticallyEqual
Description copied from class:ConstraintSyntaxTreeChecks whether thisConstraintSyntaxTreeis semantically equal to anotherConstraintSyntaxTree. Attention:This method is not fully supported by all operations and sub classes.- Overrides:
isSemanticallyEqualin classConstraintSyntaxTree- Parameters:
otherTree- Another cst to check whether it is semantically equal to this cst.- Returns:
trueif both trees are semantically equal,falseotherwise.
-