org.jfree.data
Class DateRange

java.lang.Object
  extended byorg.jfree.data.Range
      extended byorg.jfree.data.DateRange
All Implemented Interfaces:
java.io.Serializable

public class DateRange
extends Range

A range specified in terms of two java.util.Date objects.

Instances of this class are immutable.

Author:
David Gilbert, Bill Kelemen
See Also:
Serialized Form

Constructor Summary
DateRange()
          Default constructor.
DateRange(java.util.Date lower, java.util.Date upper)
          Constructs a new range.
DateRange(double lower, double upper)
          Constructs a new range.
DateRange(Range other)
          Constructs a new range based on another range.
 
Method Summary
 java.util.Date getLowerDate()
          Returns the lower bound for the range.
 java.util.Date getUpperDate()
          Returns the upper bound for the range.
 java.lang.String toString()
          Returns a string representing the date range (useful for debugging).
 
Methods inherited from class org.jfree.data.Range
combine, contains, equals, getCentralValue, getLength, getLowerBound, getUpperBound
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateRange

public DateRange()
Default constructor.


DateRange

public DateRange(java.util.Date lower,
                 java.util.Date upper)
Constructs a new range.

Parameters:
lower - the lower bound.
upper - the upper bound.

DateRange

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

Parameters:
lower - the lower (oldest) date.
upper - the upper (most recent) date.

DateRange

public DateRange(Range other)
Constructs a new range based on another range.

The other range may not be a DateRange. If it is not, the upper and lower bounds are evaluated as milliseconds since midnight GMT, 1-Jan-1970.

Parameters:
other - the other range.
Method Detail

getLowerDate

public java.util.Date getLowerDate()
Returns the lower bound for the range.

Returns:
the lower bound for the range.

getUpperDate

public java.util.Date getUpperDate()
Returns the upper bound for the range.

Returns:
the upper bound for the range.

toString

public java.lang.String toString()
Returns a string representing the date range (useful for debugging).

Overrides:
toString in class Range
Returns:
A string representing the date range.