Class Comment.Range

  • All Implemented Interfaces:
    Comparable<Comment.Range>
    Enclosing class:
    Comment

    public static final class Comment.Range
    extends Object
    implements Comparable<Comment.Range>
    The Range class defines continuous range of character.

    The pair (startLine, startChar) defines the first character in the range. The pair (endLine, endChar) defines the first character AFTER the range (i.e. it doesn't belong the range). (endLine, endChar) must be a valid character inside text, except EOF case.

    Special cases:

    • Zero length range: (startLine, startChar) = (endLine, endChar). Range defines insert position right before the (startLine, startChar) character (for FixReplacement)
    • EOF case - range includes the last character in the file:
      • if a file ends with EOL mark, then (endLine, endChar) = (num_of_lines + 1, 0)
      • if a file doesn't end with EOL mark, then (endLine, endChar) = (num_of_lines, num_of_chars_in_last_line)
    • Field Detail

      • startLine

        public int startLine
      • startChar

        public int startChar
      • endLine

        public int endLine
      • endChar

        public int endChar
    • Constructor Detail

      • Range

        public Range​(int startLine,
                     int startChar,
                     int endLine,
                     int endChar)