public abstract class Node extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ABSOLUTE_BEGIN_LINE |
static int |
ABSOLUTE_END_LINE |
Constructor and Description |
---|
Node() |
Node(int beginLine,
int beginColumn,
int endLine,
int endColumn) |
Modifier and Type | Method and Description |
---|---|
abstract <R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
abstract <A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
void |
addOrphanComment(Comment comment) |
boolean |
contains(Node other) |
boolean |
equals(Object obj) |
List<Comment> |
getAllContainedComments()
This is the list of Comment which are contained in the Node either because
they are properly associated to one of its children or because they are floating
around inside the Node
|
int |
getBeginColumn()
Return the begin column of this node.
|
int |
getBeginLine()
Return the begin line of this node.
|
List<Node> |
getChildrenNodes() |
Comment |
getComment()
This is a comment associated with this node.
|
Object |
getData()
Use this to retrieve additional information associated to this node.
|
int |
getEndColumn()
Return the end column of this node.
|
int |
getEndLine()
Return the end line of this node.
|
List<Comment> |
getOrphanComments()
This is a list of Comment which are inside the node and are not associated
with any meaningful AST Node.
|
Node |
getParentNode() |
boolean |
hasComment() |
int |
hashCode() |
boolean |
isPositionedAfter(int line,
int column) |
boolean |
isPositionedBefore(int line,
int column) |
protected void |
setAsParentNodeOf(List<? extends Node> childNodes) |
protected void |
setAsParentNodeOf(Node childNode) |
void |
setBeginColumn(int beginColumn)
Sets the begin column of this node.
|
void |
setBeginLine(int beginLine)
Sets the begin line of this node.
|
void |
setComment(Comment comment)
Use this to store additional information to this node.
|
void |
setData(Object data)
Use this to store additional information to this node.
|
void |
setEndColumn(int endColumn)
Sets the end column of this node.
|
void |
setEndLine(int endLine)
Sets the end line of this node.
|
void |
setParentNode(Node parentNode)
Assign a new parent to this node, removing it
from the list of children of the previous parent, if any.
|
String |
toString()
Return the String representation of this node.
|
String |
toStringWithoutComments() |
public static final int ABSOLUTE_BEGIN_LINE
public static final int ABSOLUTE_END_LINE
public Node()
public Node(int beginLine, int beginColumn, int endLine, int endColumn)
public abstract <R,A> R accept(GenericVisitor<R,A> v, A arg)
R
- the type the return value of the visitorA
- the type the argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitorpublic abstract <A> void accept(VoidVisitor<A> v, A arg)
A
- the type the argument passed for the visitorv
- the visitor implementationarg
- any value relevant for the visitorpublic final int getBeginColumn()
public final int getBeginLine()
public final Comment getComment()
public final Object getData()
public final int getEndColumn()
public final int getEndLine()
public final void setBeginColumn(int beginColumn)
beginColumn
- the begin column of this nodepublic final void setBeginLine(int beginLine)
beginLine
- the begin line of this nodepublic final void setComment(Comment comment)
comment
- to be setpublic final void setData(Object data)
data
- to be setpublic final void setEndColumn(int endColumn)
endColumn
- the end column of this nodepublic final void setEndLine(int endLine)
endLine
- the end line of this nodepublic final String toString()
public final String toStringWithoutComments()
public Node getParentNode()
public boolean contains(Node other)
public void addOrphanComment(Comment comment)
public List<Comment> getOrphanComments()
public List<Comment> getAllContainedComments()
public void setParentNode(Node parentNode)
parentNode
- node to be set as parentprotected void setAsParentNodeOf(Node childNode)
public boolean isPositionedAfter(int line, int column)
public boolean isPositionedBefore(int line, int column)
public boolean hasComment()
Copyright © 2007-2015. All Rights Reserved.