public class Range
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
long |
length
Length of the range.
|
long |
location
Location.
|
static long |
RangeMax
When using RangeMax as the length of the range, it means that the range is infinite.
|
Constructor and Description |
---|
Range()
Constructor for a range starting at 0 and of length 0.
|
Range(long aLocation,
long aLength)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasIntersection(Range otherRange)
Returns whether the intersection is non-empty.
|
Range |
intersection(Range otherRange)
Returns the range resulting from the intersection.
|
long |
leftBound()
Returns the included left bound of the range.
|
static Range |
rangeWithString(java.lang.String rangeString)
Create a range using a string representation.
|
IndexSet |
removeRange(Range otherRange)
Subtract otherRange from this range and returns the resulting set of indexes.
|
long |
rightBound()
Returns the included right bound of the range.
|
java.lang.String |
toString()
Returns a string representation of range.
|
IndexSet |
union(Range otherRange)
Union of otherRange and this range and returns the resulting set of indexes.
|
public long location
public long length
public static long RangeMax
public Range()
public Range(long aLocation, long aLength)
public IndexSet removeRange(Range otherRange)
public IndexSet union(Range otherRange)
public Range intersection(Range otherRange)
public boolean hasIntersection(Range otherRange)
public long leftBound()
public long rightBound()
public java.lang.String toString()
toString
in class java.lang.Object
public static Range rangeWithString(java.lang.String rangeString)