Class Node
java.lang.Object
org.checkerframework.dataflow.cfg.node.Node
- All Implemented Interfaces:
- org.plumelib.util.UniqueId
- Direct Known Subclasses:
- ArrayAccessNode,- ArrayCreationNode,- ArrayTypeNode,- AssertionErrorNode,- AssignmentNode,- BinaryOperationNode,- CaseNode,- ClassDeclarationNode,- ClassNameNode,- FieldAccessNode,- FunctionalInterfaceNode,- InstanceOfNode,- LambdaResultExpressionNode,- LocalVariableNode,- MarkerNode,- MethodAccessNode,- MethodInvocationNode,- NarrowingConversionNode,- NullChkNode,- ObjectCreationNode,- PackageNameNode,- ParameterizedTypeNode,- PrimitiveTypeNode,- ReturnNode,- StringConcatenateAssignmentNode,- StringConversionNode,- SuperNode,- SwitchExpressionNode,- SynchronizedNode,- TernaryExpressionNode,- ThisNode,- ThrowNode,- TypeCastNode,- UnaryOperationNode,- ValueLiteralNode,- VariableDeclarationNode,- WideningConversionNode
A node in the abstract representation used for Java code inside a basic block.
 
The following invariants hold:
block == null || block instanceof RegularBlock || block instanceof ExceptionBlock block != null ⇔ block.getNodes().contains(this)
type != null tree != null ⇒ node.getType() == InternalUtils.typeOf(node.getTree())Note that two
Nodes can be .equals but represent different CFG nodes. Take care
 to use reference equality, maps that handle identity IdentityHashMap, and sets like
 IdentityArraySet.- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe basic block this node belongs to.protected booleanDoes this node represent a tree that appears in the source code (true) or one that the CFG builder added while desugaring (false).protected booleanIs this node an l-value?protected final TypeMirrorThe type of this node.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract <R,P> R accept(NodeVisitor<R, P> visitor, P p) Accept method of the visitor pattern.getBlock()Returns the basic block this node belongs to (ornullif it represents the parameter of a method).booleanReturn whether this node represents a tree that appears in the source code (true) or one that the CFG or builder added while desugaring (false).abstract Collection<Node>getTree()Returns theTreein the abstract syntax tree, ornullif no corresponding tree exists.getType()Returns aTypeMirrorrepresenting the type of aNode.longgetUid()Returns the unique ID of this object.booleanisLValue()Is the node an lvalue or not?static StringnodeCollectionToString(Collection<? extends Node> nodes) Returns a verbose string representation of a collection of nodes, useful for debugging..voidSet the basic block this node belongs to.voidsetInSource(boolean inSrc) voidMake this node an l-value.Returns a verbose string representation of this, useful for debugging.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.plumelib.util.UniqueIdgetClassAndUid
- 
Field Details- 
blockThe basic block this node belongs to. If null, this object represents a method formal parameter.Is set by setBlock(org.checkerframework.dataflow.cfg.block.Block).
- 
lvalueprotected boolean lvalueIs this node an l-value?Is set by setLValue().
- 
inSourceprotected boolean inSourceDoes this node represent a tree that appears in the source code (true) or one that the CFG builder added while desugaring (false).Is set by setInSource(boolean).
- 
typeThe type of this node. ForNodes withTrees, this type is the type of theTree. Otherwise, it is the type is set by theCFGBuilder.
 
- 
- 
Constructor Details- 
NodeCreates a new Node.- Parameters:
- type- the type of the node
 
 
- 
- 
Method Details- 
getUidReturns the unique ID of this object.- Specified by:
- getUidin interface- org.plumelib.util.UniqueId
- Returns:
- the unique ID of this object
 
- 
getBlockReturns the basic block this node belongs to (ornullif it represents the parameter of a method).- Returns:
- the basic block this node belongs to (or nullif it represents the parameter of a method)
 
- 
setBlockSet the basic block this node belongs to.
- 
getTreeReturns theTreein the abstract syntax tree, ornullif no corresponding tree exists. For instance, this is the case for anImplicitThisNode.- Returns:
- the corresponding Treeornull
 
- 
getTypeReturns aTypeMirrorrepresenting the type of aNode. ANodewill always have a type even when it has noTree.- Returns:
- a TypeMirrorrepresenting the type of thisNode
 
- 
acceptAccept method of the visitor pattern.- Type Parameters:
- R- result type of the operation
- P- parameter type
- Parameters:
- visitor- the visitor to be applied to this node
- p- the parameter for this operation
 
- 
isLValueIs the node an lvalue or not?
- 
setLValuepublic void setLValue()Make this node an l-value.
- 
getInSourceReturn whether this node represents a tree that appears in the source code (true) or one that the CFG or builder added while desugaring (false).- Returns:
- whether this node represents a tree that appears in the source code
 
- 
setInSourcepublic void setInSource(boolean inSrc) 
- 
getOperands
- 
getTransitiveOperands
- 
toStringDebugReturns a verbose string representation of this, useful for debugging.- Returns:
- a printed representation of this
 
- 
nodeCollectionToStringReturns a verbose string representation of a collection of nodes, useful for debugging..- Parameters:
- nodes- a collection of nodes to format
- Returns:
- a printed representation of the given collection
 
 
-