public class TimeRangeForm extends PageSortForm
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID
CVS ID
|
protected java.lang.String |
maxDate
end of range
|
protected java.lang.String |
minDate
beginning of range
|
protected int |
plus
current range (in current unit)
|
static java.lang.String[] |
TIME_FORMATS
Formats available for input
|
java.text.DateFormat[] |
timeFormatters
Parser for dates
|
protected static java.util.Map<java.lang.String,java.lang.Integer> |
timeUnits
Maps range choices to Calendar unit fields
|
protected java.lang.String |
unit
current unit
|
EXPORT_MAX_ROWS
Constructor and Description |
---|
TimeRangeForm()
Create a new instance, minDate will be 12AM today, plus will be 1 day.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMaxDate()
Get the max date, or null if no max date has been input
|
java.lang.String |
getMinDate()
Get the start date, or null if no min date has been input
|
int |
getPlus()
Get the extent of time, in the units chosen.
|
TimeRange |
getTimeRange()
Get the time range for the inputs.
|
java.lang.String |
getTimeUnit()
Get the currently selected unit.
|
java.lang.String[] |
getTimeUnits()
Return the time unit choices.
|
java.util.Date |
parseDate(java.lang.String time)
Try to parse a time string from the user.
|
void |
setMaxDate(java.lang.String maxDate)
Set the end date for the query
|
void |
setMinDate(java.lang.String minDate)
Accept the input minimum date
|
void |
setPlus(int plus)
Set the extent of time, in the units chosen.
|
void |
setTimeRange(TimeRange timeRange)
Reset the range to a specified time range
|
void |
setTimeUnit(java.lang.String unit)
Set the unit to be used in range calculation.
|
org.apache.struts.action.ActionErrors |
validate(org.apache.struts.action.ActionMapping mapping,
javax.servlet.http.HttpServletRequest req)
Validate the form input.
|
getDir, getPage, getSize, getSort, isAscending, reset, setDir, setPage, setSize, setSort
public static final java.lang.String ID
public static final java.lang.String[] TIME_FORMATS
public final java.text.DateFormat[] timeFormatters
protected static java.util.Map<java.lang.String,java.lang.Integer> timeUnits
protected java.lang.String minDate
protected java.lang.String maxDate
protected java.lang.String unit
protected int plus
public TimeRangeForm()
public java.lang.String[] getTimeUnits()
public void setMinDate(java.lang.String minDate)
minDate
- start date for querypublic java.lang.String getMinDate()
public java.lang.String getMaxDate()
public void setMaxDate(java.lang.String maxDate)
maxDate
- end date for querypublic void setPlus(int plus)
plus
- the value for the range of timepublic int getPlus()
public java.lang.String getTimeUnit()
public void setTimeUnit(java.lang.String unit)
unit
- One of the values from getUnitspublic TimeRange getTimeRange() throws java.text.ParseException
java.text.ParseException
- Values could not be parsedpublic void setTimeRange(TimeRange timeRange)
timeRange
- the new rangepublic org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest req)
validate
in class PageSortForm
public java.util.Date parseDate(java.lang.String time)
time
- stringCopyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona