Class Range
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.coordinate.Range
-
public class Range extends Object
Represents a consecutive range of numbers, e.g. a range of selected rows: 1 - 100. Ranges are inclusive of their start value and exclusive of their end value, i.e. start <= x < end
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(int position)
Check if the given position is contained in thisRange
.boolean
equals(Object obj)
Set<Integer>
getMembers()
int[]
getMembersArray()
int
hashCode()
boolean
overlap(Range range)
int
size()
static void
sortByStart(List<Range> ranges)
Helper method to sort a list ofRange
objects by their start position.String
toString()
-
-
-
Constructor Detail
-
Range
public Range(int start, int end)
Create a newRange
.- Parameters:
start
- The start position inclusive.end
- The end position exclusive.
-
-
Method Detail
-
size
public int size()
- Returns:
- The size of this range.
-
contains
public boolean contains(int position)
Check if the given position is contained in thisRange
.- Parameters:
position
- the position to check.- Returns:
true
if the range contains the given position.
-
overlap
public boolean overlap(Range range)
-
getMembersArray
public int[] getMembersArray()
- Returns:
- The values represented by this
Range
. - Since:
- 2.0
-
-