Package org.jtool.srcmodel
Class CodeRange
java.lang.Object
org.jtool.srcmodel.CodeRange
Stores information on the range of a code fragment for an AST node.
-
Constructor Summary
ConstructorsConstructorDescriptionCodeRange
(org.eclipse.jdt.core.dom.ASTNode node) Creates code range information on a given AST node. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the bottom line number of the position that indicates the code fragment for an AST node ends.int
Returns the length of the code fragment for an AST node.int
Returns the position that indicates where the code fragment for an AST node ends.int
getLoc()
Obtains the number of lines of code fragment for an AST node.int
Returns the position that indicates where the code fragment for an AST node begins.int
Returns the upper line number of the position that indicates the code fragment for an AST node begins.toString()
Obtains information on the range of an AST node.
-
Constructor Details
-
CodeRange
public CodeRange(org.eclipse.jdt.core.dom.ASTNode node) Creates code range information on a given AST node.- Parameters:
node
- the AST node
-
-
Method Details
-
getStartPosition
public int getStartPosition()Returns the position that indicates where the code fragment for an AST node begins.- Returns:
- the value of the position on the source code
-
getEndPosition
public int getEndPosition()Returns the position that indicates where the code fragment for an AST node ends.- Returns:
- the value of the position on the source code
-
getCodeLength
public int getCodeLength()Returns the length of the code fragment for an AST node.- Returns:
- the length of the code fragment
-
getUpperLineNumber
public int getUpperLineNumber()Returns the upper line number of the position that indicates the code fragment for an AST node begins.- Returns:
- the value of the position on the source code
-
getBottomLineNumber
public int getBottomLineNumber()Returns the bottom line number of the position that indicates the code fragment for an AST node ends.- Returns:
- the value of the position on the source code
-
getLoc
public int getLoc()Obtains the number of lines of code fragment for an AST node.- Returns:
- the number of lines of the code fragment
-
toString
Obtains information on the range of an AST node.
-