Package org.jfree.data
Class DateRange
java.lang.Object
org.jfree.data.Range
org.jfree.data.DateRange
- All Implemented Interfaces:
Serializable
public class DateRange extends Range implements Serializable
A range specified in terms of two
java.util.Date objects.
Instances of this class are immutable.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DateRange()Default constructor.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(Date lower, Date upper)Constructs a new range.DateRange(Range other)Constructs a new range that is based on anotherRange. -
Method Summary
Modifier and Type Method Description DategetLowerDate()Returns the lower (earlier) date for the range.DategetUpperDate()Returns the upper (later) date for the range.StringtoString()Returns a string representing the date range (useful for debugging).Methods inherited from class org.jfree.data.Range
combine, constrain, contains, equals, expand, getCentralValue, getLength, getLowerBound, getUpperBound, hashCode, intersects
-
Constructor Details
-
DateRange
public DateRange()Default constructor. -
DateRange
Constructs a new range.- Parameters:
lower- the lower bound (nullnot permitted).upper- the upper bound (nullnot permitted).
-
DateRange
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.
-
DateRange
Constructs a new range that is based on anotherRange.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 (nullnot permitted).
-
-
Method Details
-
getLowerDate
Returns the lower (earlier) date for the range.- Returns:
- The lower date for the range.
-
getUpperDate
Returns the upper (later) date for the range.- Returns:
- The upper date for the range.
-
toString
Returns a string representing the date range (useful for debugging).
-