public final class RangeInclusiveL extends Object
Immutable type representing an inclusive range with long
components.
| Constructor and Description |
|---|
RangeInclusiveL(long in_lower,
long in_upper)
Construct an inclusive range.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
long |
getInterval()
Retrieve the number of values in the range
[lower, upper]. |
long |
getLower() |
long |
getUpper() |
int |
hashCode() |
boolean |
includesValue(long value)
Determine if the given value is included in this range.
|
boolean |
isIncludedIn(RangeInclusiveL other)
Determine if the given range is included in this range.
|
String |
toString() |
public RangeInclusiveL(long in_lower,
long in_upper)
lower <= upper.in_lower - The lower boundin_upper - The upper boundpublic long getInterval()
Retrieve the number of values in the range [lower, upper].
That is, (upper - lower) + 1.
public long getLower()
public long getUpper()
public boolean includesValue(long value)
Determine if the given value is included in this range.
value - The given valuetrue iff
value >= this.getLower() && value <= this.getUpper()
.public boolean isIncludedIn(RangeInclusiveL other)
Determine if the given range is included in this range.
other - The given rangetrue iff
this.getLower() >= other.getLower() && this.getUpper() <= other.getUpper()
.Copyright © 2014 <code@io7m.com> http://io7m.com