edu.northwestern.at.monk.model
Class DoubleRange

java.lang.Object
  extended by edu.northwestern.at.monk.model.NumericRange
      extended by edu.northwestern.at.monk.model.DoubleRange
All Implemented Interfaces:
java.lang.Comparable<DoubleRange>

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

A range of non-negative doubles.

See Also:
MONK Datastore Overview, Licensing Agreement

Constructor Summary
DoubleRange(double value)
          Creates a new range of non-negative doubles.
DoubleRange(java.lang.Double value)
          Creates a new range of non-negative doubles.
DoubleRange(double start, double end)
          Creates a new range of non-negative doubles.
DoubleRange(double start, java.lang.Double end)
          Creates a new range of non-negative doubles.
DoubleRange(java.lang.Double start, double end)
          Creates a new range of non-negative doubles.
DoubleRange(java.lang.Double start, java.lang.Double end)
          Creates a new range of non-negative doubles.
 
Method Summary
 int compareTo(DoubleRange other)
          Compares this instance with another.
 boolean equals(java.lang.Object obj)
          Returns true if this object equals some other object.
 java.lang.Double getEnd()
          Gets the end of the range.
 java.lang.Double getStart()
          Gets the start of the range.
 int hashCode()
          Returns a hash code for this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleRange

public DoubleRange(double value)
            throws ModelException
Creates a new range of non-negative doubles.

Parameters:
value - Start and end of range.
Throws:
ModelException -
Shoud never be thrown

DoubleRange

public DoubleRange(java.lang.Double value)
            throws ModelException
Creates a new range of non-negative doubles.

Parameters:
value - Start and end of range, or null if none.
Throws:
ModelException -
Shoud never be thrown

DoubleRange

public DoubleRange(double start,
                   double end)
            throws ModelException
Creates a new range of non-negative doubles.

Parameters:
start - Start of range.
end - End of range.
Throws:
ModelException -
Start is greater than end in range: start-end. (if start > end)

DoubleRange

public DoubleRange(java.lang.Double start,
                   double end)
            throws ModelException
Creates a new range of non-negative doubles.

Parameters:
start - Start of range, or null if none.
end - End of range.
Throws:
ModelException -
Start is greater than end in range: start-end. (if start > end)

DoubleRange

public DoubleRange(double start,
                   java.lang.Double end)
            throws ModelException
Creates a new range of non-negative doubles.

Parameters:
start - Start of range.
end - End of range, or null if none.
Throws:
ModelException -
Start is greater than end in range: start-end. (if start > end)

DoubleRange

public DoubleRange(java.lang.Double start,
                   java.lang.Double end)
            throws ModelException
Creates a new range of non-negative doubles.

Parameters:
start - Start of range, or null if none.
end - End of range, or null if none.
Throws:
ModelException -
Start is greater than end in range: start-end. (if start > end)
Method Detail

getStart

public java.lang.Double getStart()
Gets the start of the range.

Returns:
Start of range, or null if none.

getEnd

public java.lang.Double getEnd()
Gets the end of the range.

Returns:
End of range, or null if none.

equals

public boolean equals(java.lang.Object obj)
Returns true if this object equals some other object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - Other object.
Returns:
True if this object equals the other object.

hashCode

public int hashCode()
Returns a hash code for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
Hash code.

compareTo

public int compareTo(DoubleRange other)
Compares this instance with another.

Double ranges are ordered first by start, then by end.

Specified by:
compareTo in interface java.lang.Comparable<DoubleRange>
Parameters:
other - The other instance to be compared.
Returns:
A negative integer, zero, or a positive integer as this instance is less than, equal to, or greater than the specified instance.