Package com.qulice.checkstyle
Class LineRange
- java.lang.Object
-
- com.qulice.checkstyle.LineRange
-
public final class LineRange extends Object
Represent a line range. For example, a Java method can be described by an instance of this class. The alpha line could be the method definition and the omega line could be the end closing bracket.- Since:
- 0.16
-
-
Constructor Summary
Constructors Constructor Description LineRange(int first, int last)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
first()
Get the alpha line number.int
last()
Get the omega line number.boolean
within(int line)
Is the given line number within range.boolean
within(LineRange range)
Is the given range entirely within the LineRange.
-
-
-
Method Detail
-
within
public boolean within(int line)
Is the given line number within range.- Parameters:
line
- The given line number to check.- Returns:
- True if the given line number is within this range.
-
within
public boolean within(LineRange range)
Is the given range entirely within the LineRange. Example, given a LineRange of [10, 50], the given range of [12,48] should be within side that. And the method should return true.- Parameters:
range
- The given LineRange to check.- Returns:
- True if the given is entirely within this LineRange.
-
first
public int first()
Get the alpha line number.- Returns:
- The alpha line number.
-
last
public int last()
Get the omega line number.- Returns:
- The omega line number.
-
-