public abstract class Node extends Object
The following invariants hold:
block == null || block instanceof RegularBlock || block instanceof ExceptionBlock block instanceof RegularBlock ⇒ block.getContents().contains(this) block instanceof ExceptionBlock ⇒ block.getNode() == this block == null ⇔ "This object represents a parameter of the method."
type != null tree != null ⇒ node.getType() == InternalUtils.typeOf(node.getTree())
| Modifier and Type | Field and Description | 
|---|---|
| protected @Nullable AssignmentContext | assignmentContextThe assignment context of this node. | 
| protected @Nullable Block | blockThe basic block this node belongs to (see invariant about this field above). | 
| protected boolean | inSourceDoes this node represent a tree that appears in the source code (true) or one that the CFG
 builder added while desugaring (false). | 
| protected boolean | lvalueIs this node an l-value? | 
| protected TypeMirror | typeThe type of this node. | 
| Constructor and Description | 
|---|
| Node(TypeMirror type) | 
| Modifier and Type | Method and Description | 
|---|---|
| abstract <R,P> R | accept(NodeVisitor<R,P> visitor,
      P p)Accept method of the visitor pattern | 
| AssignmentContext | getAssignmentContext() | 
| @Nullable Block | getBlock() | 
| boolean | getInSource() | 
| abstract Collection<Node> | getOperands() | 
| Collection<Node> | getTransitiveOperands() | 
| abstract @Nullable Tree | getTree()Returns the  Treein the abstract syntax tree, ornullif no corresponding
 tree exists. | 
| TypeMirror | getType()Returns a  TypeMirrorrepresenting the type of aNodeANodewill
 always have a type even when it has noTree. | 
| boolean | isLValue() | 
| void | setAssignmentContext(AssignmentContext assignmentContext) | 
| void | setBlock(Block b)Set the basic block this node belongs to. | 
| void | setInSource(boolean inSrc) | 
| void | setLValue()Make this node an l-value. | 
protected @Nullable Block block
protected boolean lvalue
protected @Nullable AssignmentContext assignmentContext
AssignmentContext.protected boolean inSource
protected final TypeMirror type
Nodes with Trees, this type is the type of the
 Tree. Otherwise, it is the type is set by the CFGBuilder.public Node(TypeMirror type)
public @Nullable Block getBlock()
null if it represents the parameter
     of a method).public void setBlock(Block b)
public abstract @Nullable Tree getTree()
Tree in the abstract syntax tree, or null if no corresponding
 tree exists. For instance, this is the case for an ImplicitThisLiteralNode.Tree or null.public TypeMirror getType()
TypeMirror representing the type of a Node A Node will
 always have a type even when it has no Tree.TypeMirror representing the type of this Nodepublic abstract <R,P> R accept(NodeVisitor<R,P> visitor, P p)
R - result type of the operationP - parameter typevisitor - the visitor to be applied to this nodep - the parameter for this operationpublic boolean isLValue()
public void setLValue()
public boolean getInSource()
public void setInSource(boolean inSrc)
public AssignmentContext getAssignmentContext()
public void setAssignmentContext(AssignmentContext assignmentContext)
public abstract Collection<Node> getOperands()
public Collection<Node> getTransitiveOperands()