Class DeconstructorPatternNode
- java.lang.Object
-
- org.checkerframework.dataflow.cfg.node.Node
-
- org.checkerframework.dataflow.cfg.node.DeconstructorPatternNode
-
- All Implemented Interfaces:
org.plumelib.util.UniqueId
public class DeconstructorPatternNode extends Node
A node for a deconstrutor pattern.
-
-
Field Summary
Fields Modifier and Type Field Description protected @MonotonicNonNull java.util.List<LocalVariableNode>
bindingVariables
A list of nested binding variables.protected com.sun.source.tree.Tree
deconstructorPattern
TheDeconstructorPatternTree
, declared asTree
to permit this file to compile under JDK 20 and earlier.protected java.util.List<Node>
nestedPatterns
A list of nested pattern nodes.
-
Constructor Summary
Constructors Constructor Description DeconstructorPatternNode(javax.lang.model.type.TypeMirror type, com.sun.source.tree.Tree deconstructorPattern, java.util.List<Node> nestedPatterns)
Creates aDeconstructorPatternNode
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(NodeVisitor<R,P> visitor, P p)
Accept method of the visitor pattern.java.util.List<LocalVariableNode>
getBindingVariables()
Return all the binding variables in this pattern.java.util.List<Node>
getNestedPatterns()
Returns the nested patterns.java.util.Collection<Node>
getOperands()
@Nullable com.sun.source.tree.Tree
getTree()
Returns theTree
in the abstract syntax tree, ornull
if no corresponding tree exists.-
Methods inherited from class org.checkerframework.dataflow.cfg.node.Node
getBlock, getInSource, getTransitiveOperands, getType, getUid, isLValue, nodeCollectionToString, setBlock, setInSource, setLValue, toStringDebug
-
-
-
-
Field Detail
-
deconstructorPattern
protected final com.sun.source.tree.Tree deconstructorPattern
TheDeconstructorPatternTree
, declared asTree
to permit this file to compile under JDK 20 and earlier.
-
nestedPatterns
protected final java.util.List<Node> nestedPatterns
A list of nested pattern nodes.
-
bindingVariables
protected @MonotonicNonNull java.util.List<LocalVariableNode> bindingVariables
A list of nested binding variables. This is lazily initialized and should only be accessed bygetBindingVariables()
.
-
-
Constructor Detail
-
DeconstructorPatternNode
public DeconstructorPatternNode(javax.lang.model.type.TypeMirror type, com.sun.source.tree.Tree deconstructorPattern, java.util.List<Node> nestedPatterns)
Creates aDeconstructorPatternNode
.- Parameters:
type
- the type of the nodedeconstructorPattern
- theDeconstructorPatternTree
nestedPatterns
- a list of nested pattern nodes
-
-
Method Detail
-
getTree
@Pure public @Nullable com.sun.source.tree.Tree getTree()
Description copied from class:Node
Returns theTree
in the abstract syntax tree, ornull
if no corresponding tree exists. For instance, this is the case for anImplicitThisNode
.
-
getNestedPatterns
@Pure public java.util.List<Node> getNestedPatterns()
Returns the nested patterns.- Returns:
- the nested patterns
-
accept
public <R,P> R accept(NodeVisitor<R,P> visitor, P p)
Description copied from class:Node
Accept method of the visitor pattern.
-
getOperands
@Pure public java.util.Collection<Node> getOperands()
Description copied from class:Node
- Specified by:
getOperands
in classNode
- Returns:
- a collection containing all of the operand
Node
s of thisNode
-
getBindingVariables
public java.util.List<LocalVariableNode> getBindingVariables()
Return all the binding variables in this pattern.- Returns:
- all the binding variables in this pattern
-
-