lt.monarch.chart.mapper
Class DateAxisRange

java.lang.Object
  extended by lt.monarch.chart.mapper.DateAxisRange
All Implemented Interfaces:
java.io.Serializable, Range<java.util.Date>

public final class DateAxisRange
extends java.lang.Object
implements Range<java.util.Date>, java.io.Serializable

Manages a range of dates.

See Also:
Serialized Form

Constructor Summary
Constructor and Description
DateAxisRange(java.util.Date min, java.util.Date max)
          Creates a new date range with range bounds.
DateAxisRange(Range<java.util.Date> r)
          Creates a new date range with DateRange.
 
Method Summary
Modifier and Type Method and Description
 long getLongMaximum()
          Returns end date of the range in long format.
 long getLongMinimum()
          Returns start date of the range in long format.
 java.util.Date getMaximum()
          Returns end date of the range.
 java.util.Date getMinimum()
          Returns start date of the range.
 long getRange()
          Returns range length.
 boolean inRange(java.util.Date d)
          Checks whether the date is in range or not.
 void setRange(java.util.Date min, java.util.Date max)
          Sets new range.
 void setRange(Range<java.util.Date> r)
          Sets new date range.
 java.lang.String toString()
          Returns a string representation of the object.
 void updateRange(java.util.Date d)
          Updates the range for the new date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateAxisRange

public DateAxisRange(java.util.Date min,
                     java.util.Date max)
Creates a new date range with range bounds.

Parameters:
min - start range date
max - end range date

DateAxisRange

public DateAxisRange(Range<java.util.Date> r)
Creates a new date range with DateRange.

Parameters:
r - the DateRange
Method Detail

setRange

public void setRange(Range<java.util.Date> r)
Sets new date range.

Parameters:
r - the new DateRange

setRange

public void setRange(java.util.Date min,
                     java.util.Date max)
Sets new range.

Parameters:
min - start date
max - end date

updateRange

public void updateRange(java.util.Date d)
Updates the range for the new date. The range is updated to contain the specified date.

Parameters:
d - the new visible date

getRange

public final long getRange()
Returns range length.

Returns:
range length

getMinimum

public final java.util.Date getMinimum()
Returns start date of the range.

Specified by:
getMinimum in interface Range<java.util.Date>
Returns:
start date

getMaximum

public final java.util.Date getMaximum()
Returns end date of the range.

Specified by:
getMaximum in interface Range<java.util.Date>
Returns:
end date

getLongMinimum

public final long getLongMinimum()
Returns start date of the range in long format.

Returns:
start date in long format

getLongMaximum

public final long getLongMaximum()
Returns end date of the range in long format.

Returns:
end date in long format

inRange

public final boolean inRange(java.util.Date d)
Checks whether the date is in range or not.

Parameters:
d - verifying date
Returns:
true if date is in range and false otherwise

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
string representing object