Package com.google.gerrit.server.patch
Class GitPositionTransformer.Range
- java.lang.Object
-
- com.google.gerrit.server.patch.GitPositionTransformer.Range
-
- Enclosing class:
- GitPositionTransformer
public abstract static class GitPositionTransformer.Range extends Object
A range. In the context ofGitPositionTransformer
, this is a line range.
-
-
Constructor Summary
Constructors Constructor Description Range()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static GitPositionTransformer.Range
create(int start, int end)
abstract int
end()
End of the range.GitPositionTransformer.Range
shiftBy(int amount)
Creates a copy of thisRange
which is shifted by the indicated amount.abstract int
start()
Start of the range.
-
-
-
Method Detail
-
start
public abstract int start()
Start of the range. (inclusive)
-
end
public abstract int end()
End of the range. (exclusive)
-
shiftBy
public GitPositionTransformer.Range shiftBy(int amount)
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
public static GitPositionTransformer.Range create(int start, int end)
-
-