Package com.qulice.checkstyle
Class LineRanges
- java.lang.Object
- 
- com.qulice.checkstyle.LineRanges
 
- 
 public final class LineRanges extends Object Represents a set of LineRange objects. For example, an instance of this class could represent all the line ranges for methods in a given Java source code file.- Since:
- 0.16
 
- 
- 
Constructor SummaryConstructors Constructor Description LineRanges()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(LineRange line)Adds a line range to the collection.voidclear()Clears the collection.booleaninRange(int line)Detects if the given line number is within any of the line ranges.Iterator<LineRange>iterator()Returns an iterator for this collection.LineRangeswithin(LineRanges ranges)Gets the subset of LineRanges that are within all given ranges.
 
- 
- 
- 
Method Detail- 
addpublic void add(LineRange line) Adds a line range to the collection.- Parameters:
- line- The line range to add to the collection
 
 - 
iteratorpublic Iterator<LineRange> iterator() Returns an iterator for this collection.- Returns:
- Iterator pointing to the internal collections elements.
 
 - 
inRangepublic boolean inRange(int line) Detects if the given line number is within any of the line ranges.- Parameters:
- line- The given line number to check
- Returns:
- True if the given line number is within any line range.
 
 - 
withinpublic LineRanges within(LineRanges ranges) Gets the subset of LineRanges that are within all given ranges. Does not return null; instead, returns empty range if there are no matches.- Parameters:
- ranges- The ranges to filter on.
- Returns:
- Returns all LineRange elements that are within range.
 
 - 
clearpublic void clear() Clears the collection.
 
- 
 
-