public class DoubleRange extends Object implements Comparable<DoubleRange>
Constructor and Description |
---|
DoubleRange()
Should return null low and high if accessors are not called
|
DoubleRange(Double low,
Double high)
Should return infinite low and high if called with null parameters
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DoubleRange other)
first sorts according to low-bound (ascending) then according to high-bound (descending)
Should return plus 1 if this low is greater than other low
Should return minus one if this low is lower than other low
Should return plus one if both lows are equal but other high is greater than this high
Should return minus one if both lows are equal but other high is less than this high
Should return zero if both lows and both highs are equal
Should return 1 if this range is wider than other range
|
boolean |
contains(double d)
BUG: this method should return false if both ends of the range are null.
|
boolean |
equals(Object o) |
Double |
getHigh() |
Double |
getLow() |
int |
hashCode()
Should return the same hashCode for objects representing the same interval
|
void |
setHigh(Double high) |
void |
setLow(Double low) |
String |
toString() |
public DoubleRange()
public Double getHigh()
public void setHigh(Double high)
high
- The high to set.
Should set high to positive infinity on null parameter
Should cause low to have the set valuepublic Double getLow()
public void setLow(Double low)
low
- The low to set.
Should set low to negative infinity on null parameter
Should cause low to have the set valuepublic int compareTo(DoubleRange other)
compareTo
in interface Comparable<DoubleRange>
public boolean contains(double d)
d
- the Double to check for in this rangepublic String toString()
Copyright © 2024 OpenMRS Inc.. All rights reserved.