public final class TernaryOperator extends java.lang.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.
|
java.lang.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 visitorpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2022 The Apache Software Foundation. All rights reserved.