jsky.science
Class QuantityRange

java.lang.Object
  extended by jsky.science.QuantityRange

public class QuantityRange
extends java.lang.Object

A range object which contain two Quantities to make up the range.

This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project.

Version:
12/15/99
Author:
M. Fishman

Field Summary
static QuantityRange ALL_RANGE
          An all-encompassing range, from MIN_QUANTITY to MAX_QUANTITY
static QuantityRange INVALID_RANGE
          A QuantityRange with null values for both max and min
static Quantity MAX_QUANTITY
          Maximum possible Quantity/
static Quantity MIN_QUANTITY
          Minimum possible Quantity (largest negative value).
 
Constructor Summary
QuantityRange(Quantity min, Quantity max)
          Creates a QuantityRange from specified min and max
 
Method Summary
 Quantity getMaximumRange()
          Get the maximum range value.
 Quantity getMinimumRange()
          Get the minimum range value.
 boolean intersects(QuantityRange range)
          Returns whether or not this range intersects the parameter range
 java.lang.String toString()
          Represent the range as a String, in the Quantity's default units
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_QUANTITY

public static Quantity MIN_QUANTITY
Minimum possible Quantity (largest negative value).


MAX_QUANTITY

public static Quantity MAX_QUANTITY
Maximum possible Quantity/


INVALID_RANGE

public static final QuantityRange INVALID_RANGE
A QuantityRange with null values for both max and min


ALL_RANGE

public static final QuantityRange ALL_RANGE
An all-encompassing range, from MIN_QUANTITY to MAX_QUANTITY

Constructor Detail

QuantityRange

public QuantityRange(Quantity min,
                     Quantity max)
Creates a QuantityRange from specified min and max

Parameters:
min - the minimum range value
max - the maximum range value
Method Detail

getMinimumRange

public Quantity getMinimumRange()
Get the minimum range value.


getMaximumRange

public Quantity getMaximumRange()
Get the maximum range value.


intersects

public boolean intersects(QuantityRange range)
Returns whether or not this range intersects the parameter range

Parameters:
range - the range to compare against
Returns:
true if the ranges intersect and false otherwise

toString

public java.lang.String toString()
Represent the range as a String, in the Quantity's default units

Overrides:
toString in class java.lang.Object