Package org.fife.rsta.ac.java.rjc.ast
Class AbstractASTNode
- java.lang.Object
-
- org.fife.rsta.ac.java.rjc.ast.AbstractASTNode
-
- All Implemented Interfaces:
ASTNode
- Direct Known Subclasses:
AbstractMember,AbstractTypeDeclarationNode,CompilationUnit,EnumBody,ImportDeclaration,LocalVariable,Package
abstract class AbstractASTNode extends java.lang.Object implements ASTNode
Base implementation of an AST node.- Version:
- 1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractASTNode(java.lang.String name, Offset start)protectedAbstractASTNode(java.lang.String name, Offset start, Offset end)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Returns the "name" of this node.intgetNameEndOffset()Returns the end offset of the "name" of this node.intgetNameStartOffset()Returns the start offset of the "name" of this node.voidsetDeclarationEndOffset(Offset end)protected voidsetDeclarationOffsets(Offset start, Offset end)Sets the start and end offsets of this node.java.lang.StringtoString()Returns the name of this node (e.g.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the "name" of this node. This will be the name of the method, the name of the member or local variable, etc. ForCodeBlocks it will beCodeBlock.NAME.Note that this may not be unique. For example, a class with an overloaded method will have multiple methods with the same "name," just with different signatures.
-
getNameEndOffset
public int getNameEndOffset()
Returns the end offset of the "name" of this node.- Specified by:
getNameEndOffsetin interfaceASTNode- Returns:
- The end offset.
-
getNameStartOffset
public int getNameStartOffset()
Returns the start offset of the "name" of this node.- Specified by:
getNameStartOffsetin interfaceASTNode- Returns:
- The start offset.
-
setDeclarationEndOffset
public void setDeclarationEndOffset(Offset end)
-
setDeclarationOffsets
protected void setDeclarationOffsets(Offset start, Offset end)
Sets the start and end offsets of this node.- Parameters:
start- The start offset.end- The end offset.
-
toString
public java.lang.String toString()
Returns the name of this node (e.g. the value ofgetName()). Subclasses can override this method if appropriate.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of this node.
-
-