org.openmrs.util
Class DoubleRange

java.lang.Object
  extended by org.openmrs.util.DoubleRange
All Implemented Interfaces:
java.lang.Comparable<DoubleRange>

public class DoubleRange
extends java.lang.Object
implements java.lang.Comparable<DoubleRange>

Represents a bounded or unbounded numeric range. By default the range is closed (ake inclusive) on the low end and open (aka exclusive) on the high end: mathematically "[low, high)". (I'm not using the similarly-named class from Apache commons because it doesn't implement comparable, and because it only allows inclusive bounds.)


Constructor Summary
DoubleRange()
           
DoubleRange(java.lang.Double low, java.lang.Double high)
           
 
Method Summary
 int compareTo(DoubleRange other)
          first sorts according to low-bound (ascending) then according to high-bound (descending)
 boolean contains(double d)
           
 boolean equals(java.lang.Object o)
           
 java.lang.Double getHigh()
           
 java.lang.Double getLow()
           
 void setHigh(java.lang.Double high)
           
 void setLow(java.lang.Double low)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleRange

public DoubleRange()

DoubleRange

public DoubleRange(java.lang.Double low,
                   java.lang.Double high)
Method Detail

getHigh

public java.lang.Double getHigh()
Returns:
Returns the high.

setHigh

public void setHigh(java.lang.Double high)
Parameters:
high - The high to set.

getLow

public java.lang.Double getLow()
Returns:
Returns the low.

setLow

public void setLow(java.lang.Double low)
Parameters:
low - The low to set.

compareTo

public int compareTo(DoubleRange other)
first sorts according to low-bound (ascending) then according to high-bound (descending)

Specified by:
compareTo in interface java.lang.Comparable<DoubleRange>

contains

public boolean contains(double d)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change