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
FieldsModifier and TypeFieldDescriptionprotected @MonotonicNonNull List<LocalVariableNode> A list of all binding variables in this instanceof.protected final NodeThe value being tested.The node of the pattern if one exists.protected final TypeMirrorThe reference type being tested against.protected final InstanceOfTreeThe tree associated with this node.protected final TypesFor Types.isSameType. -
Constructor Summary
ConstructorsConstructorDescriptionInstanceOfNode(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.booleanDeprecated.Returns 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 theTreein the abstract syntax tree, ornullif no corresponding tree exists.inthashCode()toString()Methods inherited from class org.checkerframework.dataflow.cfg.node.Node
getBlock, getInSource, getTransitiveOperands, getType, getUid, isLValue, nodeCollectionToString, setBlock, setInSource, setLValue, toStringDebugMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
Returns 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:NodeReturns theTreein the abstract syntax tree, ornullif no corresponding tree exists. For instance, this is the case for anImplicitThisNode. -
accept
Description copied from class:NodeAccept method of the visitor pattern. -
toString
-
equals
-
hashCode
public int hashCode() -
getOperands
Description copied from class:Node- Specified by:
getOperandsin classNode- Returns:
- a collection containing all of the operand
Nodes of thisNode
-
getPatternNode()orgetBindingVariables()instead.