public final class TernaryOperator extends Object implements ExpressionNode
condition ? then : else
).Constructor and Description |
---|
TernaryOperator(ExpressionNode condition,
ExpressionNode thenBranch,
ExpressionNode elseBranch)
Creates the operator.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(NodeVisitor<T> visitor)
Accept a visitor to process this node.
|
ExpressionNode |
getCondition()
Returns the condition of this operator.
|
ExpressionNode |
getElseBranch()
Returns the "else" branch.
|
ExpressionNode |
getThenBranch()
Returns the "then" branch.
|
String |
toString() |
public TernaryOperator(ExpressionNode condition, ExpressionNode thenBranch, ExpressionNode elseBranch)
condition
- the operator's conditionthenBranch
- the "then" branchelseBranch
- the "else" branchpublic ExpressionNode getCondition()
public ExpressionNode getThenBranch()
public ExpressionNode getElseBranch()
public <T> T accept(NodeVisitor<T> visitor)
ExpressionNode
accept
in interface ExpressionNode
T
- the type of the visitorvisitor
- The visitorCopyright © 2017 The Apache Software Foundation. All rights reserved.