com.jrefinery.data
Class Range

java.lang.Object
  extended by com.jrefinery.data.Range
Direct Known Subclasses:
DateRange

public class Range
extends java.lang.Object

Represents the visible range for an axis.


Field Summary
protected  double lower
          The lower bound for the visible range.
protected  double upper
          The upper bound for the visible range.
 
Constructor Summary
Range(double lower, double upper)
          Constructs a new axis range.
 
Method Summary
static Range combine(Range range1, Range range2)
          Creates a new range by combining two existing ranges.
 boolean contains(double value)
          Returns true if the range contains the specified value.
 double getCentralValue()
          Returns the central value for the range.
 double getLength()
          Returns the length of the range.
 double getLowerBound()
          Returns the lower bound for the range.
 double getUpperBound()
          Returns the upper bound for the range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lower

protected double lower
The lower bound for the visible range.


upper

protected double upper
The upper bound for the visible range.

Constructor Detail

Range

public Range(double lower,
             double upper)
Constructs a new axis range.

Parameters:
lower - The lower bound.
upper - The upper bound.
Method Detail

getLowerBound

public double getLowerBound()
Returns the lower bound for the range.

Returns:
The lower bound.

getUpperBound

public double getUpperBound()
Returns the upper bound for the range.

Returns:
The upper bound.

getLength

public double getLength()
Returns the length of the range.

Returns:
The length.

getCentralValue

public double getCentralValue()
Returns the central value for the range.

Returns:
The central value.

contains

public boolean contains(double value)
Returns true if the range contains the specified value.


combine

public static Range combine(Range range1,
                            Range range2)
Creates a new range by combining two existing ranges.

Parameters:
range1 - The first range.
range2 - The second range.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.