Class Overview
A range specified in terms of two java.util.Date
objects.
Instances of this class are immutable.
Summary
Public Constructors |
|
DateRange()
Default constructor.
|
|
DateRange(Date lower, Date upper)
Constructs a new range.
|
|
DateRange(double lower, double upper)
Constructs a new range using two values that will be interpreted as
"milliseconds since midnight GMT, 1-Jan-1970".
|
|
DateRange(Range other)
Constructs a new range that is based on another Range .
|
Public Methods |
Date
|
getLowerDate()
Returns the lower (earlier) date for the range.
|
long
|
getLowerMillis()
Returns the lower bound of the range in milliseconds.
|
Date
|
getUpperDate()
Returns the upper (later) date for the range.
|
long
|
getUpperMillis()
Returns the upper bound of the range in milliseconds.
|
String
|
toString()
Returns a string representing the date range (useful for debugging).
|
[Expand]
Inherited Methods |
From class
org.jfree.data.Range
static
Range
|
combine(Range range1, Range range2)
Creates a new range by combining two existing ranges.
|
double
|
constrain(double value)
Returns the value within the range that is closest to the specified
value.
|
boolean
|
contains(double value)
Returns true if the range contains the specified value and
false otherwise.
|
boolean
|
equals(Object obj)
Tests this object for equality with an arbitrary object.
|
static
Range
|
expand(Range range, double lowerMargin, double upperMargin)
Creates a new range by adding margins to an existing range.
|
static
Range
|
expandToInclude(Range range, double value)
Returns a range that includes all the values in the specified
range AND 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.
|
int
|
hashCode()
Returns a hash code.
|
boolean
|
intersects(Range range)
Returns true if the range intersects with the specified
range, and false otherwise.
|
boolean
|
intersects(double b0, double b1)
Returns true if the range intersects with the specified
range, and false otherwise.
|
static
Range
|
scale(Range base, double factor)
Scales the range by the specified factor.
|
static
Range
|
shift(Range base, double delta, boolean allowZeroCrossing)
Shifts the range by the specified amount.
|
static
Range
|
shift(Range base, double delta)
Shifts the range by the specified amount.
|
String
|
toString()
Returns a string representation of this Range.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Public Constructors
public
DateRange
(Date lower, Date upper)
Parameters
lower
| the lower bound (null not permitted). |
upper
| the upper bound (null not permitted).
|
public
DateRange
(double lower, double upper)
Constructs a new range using two values that will be interpreted as
"milliseconds since midnight GMT, 1-Jan-1970".
Parameters
lower
| the lower (oldest) date. |
upper
| the upper (most recent) date.
|
public
DateRange
(Range other)
Constructs a new range that is based on another Range
. The
other range does not have to 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 (null not permitted).
|
Public Methods
public
Date
getLowerDate
()
Returns the lower (earlier) date for the range.
Returns
- The lower date for the range.
public
long
getLowerMillis
()
Returns the lower bound of the range in milliseconds.
public
Date
getUpperDate
()
Returns the upper (later) date for the range.
Returns
- The upper date for the range.
public
long
getUpperMillis
()
Returns the upper bound of the range in milliseconds.
public
String
toString
()
Returns a string representing the date range (useful for debugging).
Returns
- A string representing the date range.