public class CaseNode extends Node
case constant:
Modifier and Type | Field and Description |
---|---|
protected List<Node> |
caseExprs
The case expression to match the switch expression against.
|
protected Node |
switchExpr
The switch expression.
|
protected CaseTree |
tree
The tree for this node.
|
Constructor and Description |
---|
CaseNode(CaseTree tree,
Node switchExpr,
List<Node> caseExprs,
Types types)
Create a new CaseNode.
|
Modifier and Type | Method and Description |
---|---|
<R,P> R |
accept(NodeVisitor<R,P> visitor,
P p)
Accept method of the visitor pattern.
|
boolean |
equals(@Nullable Object obj) |
List<Node> |
getCaseOperands()
Gets the nodes corresponding to the case expressions.
|
Collection<Node> |
getOperands()
|
Node |
getSwitchOperand() |
CaseTree |
getTree()
Returns the
Tree in the abstract syntax tree, or null if no corresponding tree
exists. |
int |
hashCode() |
String |
toString() |
getBlock, getInSource, getTransitiveOperands, getType, getUid, isLValue, nodeCollectionToString, setBlock, setInSource, setLValue, toStringDebug
protected final CaseTree tree
protected final Node switchExpr
public CaseNode(CaseTree tree, Node switchExpr, List<Node> caseExprs, Types types)
tree
- the tree for this nodeswitchExpr
- the switch expressioncaseExprs
- the case expression(s) to match the switch expression againsttypes
- a factory of utility methods for operating on typespublic Node getSwitchOperand()
public List<Node> getCaseOperands()
public CaseTree getTree()
Node
Tree
in the abstract syntax tree, or null
if no corresponding tree
exists. For instance, this is the case for an ImplicitThisNode
.public <R,P> R accept(NodeVisitor<R,P> visitor, P p)
Node
public Collection<Node> getOperands()
Node
getOperands
in class Node
Node
s of this Node