Class InstanceOfNode
java.lang.Object
org.checkerframework.dataflow.cfg.node.Node
org.checkerframework.dataflow.cfg.node.InstanceOfNode
- All Implemented Interfaces:
org.plumelib.util.UniqueId
A node for the instanceof operator:
x instanceof Point
-
Field Summary
Modifier and TypeFieldDescriptionprotected @MonotonicNonNull List
<LocalVariableNode> A list of all binding variables in this instanceof.protected final Node
The value being tested.The node of the pattern if one exists.protected final TypeMirror
The reference type being tested against.protected final InstanceOfTree
The tree associated with this node.protected final Types
For Types.isSameType. -
Constructor Summary
ConstructorDescriptionInstanceOfNode
(InstanceOfTree tree, Node operand, TypeMirror refType, Types types) Create an InstanceOfNode.InstanceOfNode
(InstanceOfTree tree, Node operand, @Nullable Node patternNode, TypeMirror refType, Types types) Create an InstanceOfNode. -
Method Summary
Modifier and TypeMethodDescription<R,
P> R accept
(NodeVisitor<R, P> visitor, P p) Accept method of the visitor pattern.boolean
Deprecated.Return all the binding variables in this instanceof.Returns the pattern for this instanceof, or null if one does not exist.The reference type being tested against.getTree()
Returns theTree
in the abstract syntax tree, ornull
if no corresponding tree exists.int
hashCode()
toString()
Methods inherited from class org.checkerframework.dataflow.cfg.node.Node
getBlock, getInSource, getTransitiveOperands, getType, getUid, isLValue, nodeCollectionToString, setBlock, setInSource, setLValue, toStringDebug
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.plumelib.util.UniqueId
getClassAndUid
-
Field Details
-
operand
The value being tested. -
refType
The reference type being tested against. -
tree
The tree associated with this node. -
patternNode
The node of the pattern if one exists. -
types
For Types.isSameType. -
bindingVariables
A list of all binding variables in this instanceof. This is lazily initialized, usegetBindingVariables()
.
-
-
Constructor Details
-
InstanceOfNode
Create an InstanceOfNode.- Parameters:
tree
- instanceof treeoperand
- the expression in the instanceof treerefType
- the type in the instanceoftypes
- types util
-
InstanceOfNode
public InstanceOfNode(InstanceOfTree tree, Node operand, @Nullable Node patternNode, TypeMirror refType, Types types) Create an InstanceOfNode.- Parameters:
tree
- instanceof treeoperand
- the expression in the instanceof treepatternNode
- the pattern node or null if there is nonerefType
- the type in the instanceoftypes
- types util
-
-
Method Details
-
getOperand
-
getBindingVariable
Deprecated.UsegetPatternNode()
orgetBindingVariables()
instead.Returns the binding variable for this instanceof, or null if one does not exist.- Returns:
- the binding variable for this instanceof, or null if one does not exist
-
getBindingVariables
Return all the binding variables in this instanceof.- Returns:
- all the binding variables in this instanceof
-
getPatternNode
Returns the pattern for this instanceof, or null if one does not exist.- Returns:
- the pattern for this instanceof, or null if one does not exist
-
getRefType
The reference type being tested against.- Returns:
- the reference type
-
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
. -
accept
Description copied from class:Node
Accept method of the visitor pattern. -
toString
-
equals
-
hashCode
public int hashCode() -
getOperands
Description copied from class:Node
- Specified by:
getOperands
in classNode
- Returns:
- a collection containing all of the operand
Node
s of thisNode
-
getPatternNode()
orgetBindingVariables()
instead.