Package com.google.gerrit.server.patch
Class GitPositionTransformer.Range
java.lang.Object
com.google.gerrit.server.patch.GitPositionTransformer.Range
- Enclosing class:
- GitPositionTransformer
A range. In the context of
GitPositionTransformer
, this is a line range.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GitPositionTransformer.Range
create
(int start, int end) abstract int
end()
End of the range.shiftBy
(int amount) Creates a copy of thisRange
which is shifted by the indicated amount.abstract int
start()
Start of the range.
-
Constructor Details
-
Range
public Range()
-
-
Method Details
-
start
public abstract int start()Start of the range. (inclusive) -
end
public abstract int end()End of the range. (exclusive) -
shiftBy
Creates a copy of thisRange
which is shifted by the indicated amount. A shift equally applies to bothstart()
endend()
.Note: There's no guarantee that this method returns a new instance.
- Parameters:
amount
- amount to shift. Negative values mean moving the range up, positive values mean moving the range down.- Returns:
- a
Range
instance with updated start/end
-
create
-