Interface TextBlock

  • All Known Implementing Classes:
    Comment

    public interface TextBlock
    A block of text from an input file that does not necessarily have any grammatical structure.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      int getEndColNo()
      The column in the input file where the text block ends.
      int getEndLineNo()
      The last line of the text block in the input file.
      int getStartColNo()
      The column in the input file where the text block starts.
      int getStartLineNo()
      The line in the input file where the text block starts.
      String[] getText()
      The text content of the text block.
      boolean intersects​(int startLineNo, int startColNo, int endLineNo, int endColNo)
      Checks if this comment intersects with a specified part of the file.
    • Method Detail

      • getText

        String[] getText()
        The text content of the text block. Each line is represented by one array entry. The linebreak characters are not part of the text content.
        Returns:
        the text content of the text block.
      • getStartLineNo

        int getStartLineNo()
        The line in the input file where the text block starts. Counting starts from 1.
        Returns:
        first line of the text block
      • getEndLineNo

        int getEndLineNo()
        The last line of the text block in the input file. Counting starts from 1.
        Returns:
        last line of the text block
      • getStartColNo

        int getStartColNo()
        The column in the input file where the text block starts. Counting starts from 0.
        Returns:
        first line of the text block
      • getEndColNo

        int getEndColNo()
        The column in the input file where the text block ends. Counting starts from 0.
        Returns:
        last line of the text block
      • intersects

        boolean intersects​(int startLineNo,
                           int startColNo,
                           int endLineNo,
                           int endColNo)
        Checks if this comment intersects with a specified part of the file.
        Parameters:
        startLineNo - the starting line number in the file
        startColNo - the starting column number in the file
        endLineNo - the ending line number in the file
        endColNo - the ending column number in the file
        Returns:
        true if the positions intersects with this comment.