HiRISE

HiRISE.HiReport.model
Class TimeRange

java.lang.Object
  extended by HiRISE.HiReport.model.TimeRange
All Implemented Interfaces:
Serializable

public class TimeRange
extends Object
implements Serializable

Represents a range of (local) time, by default beginning at 12am on the current date and ending at the time the range is constructed.

See Also:
Serialized Form

Field Summary
static String ID
          CVS ID
protected  Calendar maxDate
          The ending time
protected  Calendar minDate
          The starting time
 
Constructor Summary
TimeRange()
          Create a new time range.
TimeRange(Date min, Date max)
          Create a new time range with specific values.
 
Method Summary
 void addToMax(int unit, int range)
          Add a Calendar value to the end time
 void addToMin(int unit, int range)
          Add a Calendar value to the start time.
 Date getMaxDate()
          Get the ending time
 Date getMinDate()
          Get the starting time
 void setMaxDate(Date maxDate)
          Set the ending time
 void setMaxDate(int unit, int range)
          Set a value on the end time
 void setMinDate(Date minDate)
          Set the starting time
 void setMinDate(int unit, int range)
          Set a value on the start time
 String toString()
          Returns a string representing the time range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
CVS ID

See Also:
Constant Field Values

minDate

protected Calendar minDate
The starting time


maxDate

protected Calendar maxDate
The ending time

Constructor Detail

TimeRange

public TimeRange()
Create a new time range. It will begin at the start of the current date and end at the current time.


TimeRange

public TimeRange(Date min,
                 Date max)
Create a new time range with specific values.

Parameters:
min - lower bound on range
max - upper bound on range
Method Detail

getMinDate

public Date getMinDate()
Get the starting time

Returns:
start

getMaxDate

public Date getMaxDate()
Get the ending time

Returns:
end

setMinDate

public void setMinDate(Date minDate)
Set the starting time

Parameters:
minDate - start

setMaxDate

public void setMaxDate(Date maxDate)
Set the ending time

Parameters:
maxDate - end

setMinDate

public void setMinDate(int unit,
                       int range)
Set a value on the start time

Parameters:
unit - Field of Calendar
range - Amount

setMaxDate

public void setMaxDate(int unit,
                       int range)
Set a value on the end time

Parameters:
unit - Field of Calendar
range - Amount

addToMin

public void addToMin(int unit,
                     int range)
Add a Calendar value to the start time.

Parameters:
unit - Field of Calendar
range - Amount

addToMax

public void addToMax(int unit,
                     int range)
Add a Calendar value to the end time

Parameters:
unit - Field of Calendar
range - Amount

toString

public String toString()
Returns a string representing the time range.

Overrides:
toString in class Object
Returns:
time range as string

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona