com.ijchart.xychart.range
Class DateRange

java.lang.Object
  extended by com.ijchart.xychart.range.NumberRange
      extended by com.ijchart.xychart.range.DateRange
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class DateRange
extends NumberRange
implements java.io.Serializable, java.lang.Cloneable

Title: IJChart

Description: a chart library for the Java(tm) platform.

A range specified in terms of two java.util.Date objects. Instances of this class are immutable.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ijchart.xychart.range.NumberRange
RANGE_ZERO
 
Constructor Summary
DateRange(java.util.Date lower, java.util.Date upper)
           Constructs a new range.
DateRange(long lower, long upper)
           Constructs a new range using two values that will be interpreted as "milliseconds since midnight GMT, 1-Jan-1970".
DateRange(NumberRange other)
           Constructs a new range that is based on another NumberRange.
 
Method Summary
protected  java.lang.Object clone()
           Creates and returns a copy of this object.
 boolean equals(java.lang.Object obj)
           Tests the marker for equality with an arbitrary double.
 java.util.Date getLowerDate()
           Returns the lower (earlier) date for the range.
 java.util.Date getUpperDate()
           Returns the upper (later) date for the range.
 int hashCode()
           Returns a hash code.
 java.lang.String toString()
           Returns a string representing the date range (useful for debugging).
 
Methods inherited from class com.ijchart.xychart.range.NumberRange
contains, getCentralValue, getLength, getLowerBound, getUpperBound, resizeRange, resizeRange, resizeRange2, zoomRange
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateRange

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

Parameters:
lower - The lower bound (null not permitted).
upper - The upper bound (null not permitted).

DateRange

public DateRange(long lower,
                 long 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

public DateRange(NumberRange other)
Constructs a new range that is based on another NumberRange. 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).
Method Detail

getLowerDate

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

Returns:
The lower date for the range.

getUpperDate

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

Returns:
The upper date for the range.

equals

public boolean equals(java.lang.Object obj)
Tests the marker for equality with an arbitrary double.

Overrides:
equals in class NumberRange
Parameters:
obj - the double (null permitted).
Returns:
A boolean.

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class NumberRange
Returns:
Object
Throws:
java.lang.CloneNotSupportedException

hashCode

public int hashCode()
Returns a hash code.

Overrides:
hashCode in class NumberRange
Returns:
A hash code.

toString

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

Overrides:
toString in class NumberRange
Returns:
A string