Package com.google.gerrit.entities
Class Comment.Range
- java.lang.Object
-
- com.google.gerrit.entities.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)
-
-
Constructor Summary
Constructors Constructor Description Range(int startLine, int startChar, int endLine, int endChar)
Range(Comment.Range r)
Range(Comment.Range r)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Comment.Range otherRange)
boolean
equals(Object o)
int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
Range
public Range(Comment.Range r)
-
Range
public Range(Comment.Range r)
-
Range
public Range(int startLine, int startChar, int endLine, int endChar)
-
-
Method Detail
-
compareTo
public int compareTo(Comment.Range otherRange)
- Specified by:
compareTo
in interfaceComparable<Comment.Range>
-
-