Class CaseNode
java.lang.Object
org.checkerframework.dataflow.cfg.node.Node
org.checkerframework.dataflow.cfg.node.CaseNode
- All Implemented Interfaces:
- org.plumelib.util.UniqueId
A node for a case in a switch statement. Although a case has no abstract value, it can imply
 facts about the abstract values of its operands.
 
case constant:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe case expressions to match the switch expression against: the operands of (possibly multiple) case labels.The guard (the expression in thewhenclause) for this case.protected final AssignmentNodeThe Node for the assignment of the switch selector expression to a synthetic local variable.protected final CaseTreeThe tree for this node.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<R,P> R accept(NodeVisitor<R, P> visitor, P p) Accept method of the visitor pattern.booleanGets the nodes corresponding to the case expressions.getGuard()Gets the node for the guard (the expression in thewhenclause).The Node for the assignment of the switch selector expression to a synthetic local variable.getTree()Returns theTreein the abstract syntax tree, ornullif no corresponding tree exists.inthashCode()toString()Methods inherited from class org.checkerframework.dataflow.cfg.node.NodegetBlock, getInSource, getTransitiveOperands, getType, getUid, isLValue, nodeCollectionToString, setBlock, setInSource, setLValue, toStringDebugMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.plumelib.util.UniqueIdgetClassAndUid
- 
Field Details- 
treeThe tree for this node.
- 
selectorExprAssignmentThe Node for the assignment of the switch selector expression to a synthetic local variable.
- 
caseExprsThe case expressions to match the switch expression against: the operands of (possibly multiple) case labels.
- 
guardThe guard (the expression in thewhenclause) for this case.
 
- 
- 
Constructor Details- 
CaseNodepublic CaseNode(CaseTree tree, AssignmentNode selectorExprAssignment, List<Node> caseExprs, @Nullable Node guard, Types types) Create a new CaseNode.- Parameters:
- tree- the tree for this node
- selectorExprAssignment- the Node for the assignment of the switch selector expression to a synthetic local variable
- caseExprs- the case expression(s) to match the switch expression against
- guard- the guard expression or null
- types- a factory of utility methods for operating on types
 
 
- 
- 
Method Details- 
getSwitchOperandThe Node for the assignment of the switch selector expression to a synthetic local variable. This is used to refine the type of the switch selector expression in a case block.- Returns:
- the assignment of the switch selector expression to a synthetic local variable
 
- 
getCaseOperandsGets the nodes corresponding to the case expressions. There can be multiple expressions since Java 12.- Returns:
- the nodes corresponding to the (potentially multiple) case expressions
 
- 
getGuardGets the node for the guard (the expression in thewhenclause).- Returns:
- the node for the guard
 
- 
getTreeDescription copied from class:NodeReturns theTreein the abstract syntax tree, ornullif no corresponding tree exists. For instance, this is the case for anImplicitThisNode.
- 
acceptDescription copied from class:NodeAccept method of the visitor pattern.
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
getOperandsDescription copied from class:Node- Specified by:
- getOperandsin class- Node
- Returns:
- a collection containing all of the operand Nodes of thisNode
 
 
-