Class CodeRange

java.lang.Object
org.jtool.srcmodel.CodeRange

public class CodeRange extends Object
Stores information on the range of a code fragment for an AST node.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CodeRange(org.eclipse.jdt.core.dom.ASTNode node)
    Creates code range information on a given AST node.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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
    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.
    Obtains information on the range of an AST node.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • 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

      public String toString()
      Obtains information on the range of an AST node.
      Overrides:
      toString in class Object
      Returns:
      the string representing the information