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
public class IfThen extends ConstraintSyntaxTree
Represents a conditional expression.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private ConstraintSyntaxTreeelseExprprivate ConstraintSyntaxTreeifExprprivate IDatatyperesultprivate ConstraintSyntaxTreethenExpr
-
Constructor Summary
Constructors Constructor Description IfThen()Constructor for serialization.IfThen(ConstraintSyntaxTree ifExpr, ConstraintSyntaxTree thenExpr, ConstraintSyntaxTree elseExpr)Creates a new if-then-else node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IConstraintTreeVisitor visitor)Visiting method for the visitor.booleanequals(java.lang.Object obj)ConstraintSyntaxTreegetElseExpr()Returns the else-expression.ConstraintSyntaxTreegetIfExpr()Returns the condition expression.ConstraintSyntaxTreegetThenExpr()Returns the then-expression.inthashCode()IDatatypeinferDatatype()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 Detail
-
ifExpr
private ConstraintSyntaxTree ifExpr
-
thenExpr
private ConstraintSyntaxTree thenExpr
-
elseExpr
private ConstraintSyntaxTree elseExpr
-
result
private IDatatype result
-
-
Constructor Detail
-
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 Detail
-
getIfExpr
public ConstraintSyntaxTree getIfExpr()
Returns the condition expression.- Returns:
- the condition expression
-
getThenExpr
public ConstraintSyntaxTree getThenExpr()
Returns the then-expression.- Returns:
- the then-expression
-
getElseExpr
public ConstraintSyntaxTree getElseExpr()
Returns the else-expression.- Returns:
- the else-expression
-
inferDatatype
public IDatatype inferDatatype() throws CSTSemanticException
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
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
-
-