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 final @Nullable LocalVariableNode
The node of the binding variable if one exists.protected final Node
The value being tested.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, @Nullable LocalVariableNode bindingVariable, TypeMirror refType, Types types) Create an InstanceOfNode.InstanceOfNode
(InstanceOfTree tree, Node operand, 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
Returns the binding variable 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. -
bindingVariable
The node of the binding variable if one exists. -
types
For Types.isSameType.
-
-
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 LocalVariableNode bindingVariable, TypeMirror refType, Types types) Create an InstanceOfNode.- Parameters:
tree
- instanceof treeoperand
- the expression in the instanceof treebindingVariable
- the binding variable or null if there is nonerefType
- the type in the instanceoftypes
- types util
-
-
Method Details
-
getOperand
-
getBindingVariable
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
-
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
-