-
- All Superinterfaces:
StatementTree,Tree
public interface IfTree extends StatementTree
A tree node for an 'if' statement. For example:if ( condition ) thenStatement if ( condition ) thenStatement else elseStatement- Since:
- 9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExpressionTreegetCondition()Returns the condition expression of this 'if' statement.StatementTreegetElseStatement()Returns the then statement of this 'if' statement.StatementTreegetThenStatement()Returns the 'then' statement of this 'if' statement.-
Methods inherited from interface jdk.nashorn.api.tree.Tree
accept, getEndPosition, getKind, getStartPosition
-
-
-
-
Method Detail
-
getCondition
ExpressionTree getCondition()
Returns the condition expression of this 'if' statement.- Returns:
- the condition expression
-
getThenStatement
StatementTree getThenStatement()
Returns the 'then' statement of this 'if' statement.- Returns:
- the 'then' statement
-
getElseStatement
StatementTree getElseStatement()
Returns the then statement of this 'if' statement. null if this if statement has no else branch.- Returns:
- the 'else' statement
-
-