public class Range extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private double |
lower |
private double |
upper |
static Range |
ZERO_TO_INFINITY |
Constructor and Description |
---|
Range(double lower,
double upper) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(double x) |
static Range |
cut(Range a,
Range b)
provides the intersection of 2 overlapping ranges
|
boolean |
equals(java.lang.Object o) |
double |
getLower() |
double |
getUpper() |
int |
hashCode() |
Range |
reduceAround(double x,
Range other)
under the premise, that x is within this range,
and not within the other range, it shrinks this range in a way
to exclude the other range, but still contain x.
|
java.lang.String |
toString() |
private final double lower
private final double upper
public static final Range ZERO_TO_INFINITY
public Range(double lower, double upper)
public boolean contains(double x)
public Range reduceAround(double x, Range other)
public double getLower()
public double getUpper()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object