Package net.ssehub.easy.varModel.cst
Class IfThen
java.lang.Object
net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
net.ssehub.easy.varModel.cst.IfThen
- All Implemented Interfaces:
IAttributeAccess
Represents a conditional expression.
- Author:
- Holger Eichelberger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConstraintSyntaxTreeprivate ConstraintSyntaxTreeprivate IDatatypeprivate ConstraintSyntaxTree -
Constructor Summary
ConstructorsConstructorDescriptionIfThen()Constructor for serialization.IfThen(ConstraintSyntaxTree ifExpr, ConstraintSyntaxTree thenExpr, ConstraintSyntaxTree elseExpr) Creates a new if-then-else node. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(IConstraintTreeVisitor visitor) Visiting method for the visitor.booleanReturns the else-expression.Returns the condition expression.Returns the then-expression.inthashCode()Infers the datatype of the subtree represented by this object.Methods inherited from class net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
getAttribute, getAttribute, getAttributesCount, getContainedType, getName, getParent, isSemanticallyEqual
-
Field Details
-
ifExpr
-
thenExpr
-
elseExpr
-
result
-
-
Constructor Details
-
IfThen
IfThen()Constructor for serialization. -
IfThen
public IfThen(ConstraintSyntaxTree ifExpr, ConstraintSyntaxTree thenExpr, ConstraintSyntaxTree elseExpr) Creates a new if-then-else node.- Parameters:
ifExpr- the condition expressionthenExpr- the then-path-expressionelseExpr- the else-path-expression
-
-
Method Details
-
getIfExpr
Returns the condition expression.- Returns:
- the condition expression
-
getThenExpr
Returns the then-expression.- Returns:
- the then-expression
-
getElseExpr
Returns the else-expression.- Returns:
- the else-expression
-
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()
-