|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.unidata.util.DateSelection
public class DateSelection
Holds state for constructing time based queries.
Field Summary | |
---|---|
static String |
ARG_COUNT
url argument names |
static String |
ARG_ENDFIXEDTIME
url argument names |
static String |
ARG_ENDMODE
url argument names |
static String |
ARG_ENDOFFSET
url argument names |
static String |
ARG_INTERVAL
url argument names |
static String |
ARG_POSTRANGE
url argument names |
static String |
ARG_PRERANGE
url argument names |
static String |
ARG_ROUNDTO
url argument names |
static String |
ARG_SKIP
url argument names |
static String |
ARG_STARTFIXEDTIME
url argument names |
static String |
ARG_STARTMODE
url argument names |
static String |
ARG_STARTOFFSET
url argument names |
boolean |
debug
debug flag |
static String[] |
ENDMODELABELS
Mode for constructing set |
static int |
MAX_COUNT
maximum count |
static String[] |
STARTMODELABELS
Mode for constructing set |
static int |
TIMEMODE_CURRENT
The mode for when we use the current time |
static int |
TIMEMODE_DATA
Mode for using the first or last time in the data set. |
static int |
TIMEMODE_FIXED
The mode for when we have an absolute time as a range bounds |
static int |
TIMEMODE_RELATIVE
When one of the ranges is relative to another |
static int[] |
TIMEMODES
Mode for constructing set |
static String[] |
TIMEMODESTRINGS
string ids for time modes |
Constructor Summary | |
---|---|
DateSelection()
ctor |
|
DateSelection(boolean doAll)
ctor |
|
DateSelection(boolean doLatest,
int count)
ctor |
|
DateSelection(Date startTime,
Date endTime)
ctor |
|
DateSelection(DateSelection that)
copy ctor |
|
DateSelection(Hashtable<String,String> args)
ctor for instantiating a DateSelection object from a set of url argument originally created from toUrlString |
|
DateSelection(int startMode,
double startOffset,
int endMode,
double endOffset)
Construct a DateSelection |
Method Summary | |
---|---|
List |
apply(List times)
Apply this date selection query to the list of DatedThing-s |
boolean |
equals(Object o)
equals method |
int |
getCount()
Get the Count property. |
boolean |
getDoAll()
Get the DoAll property. |
boolean |
getDoLatest()
Get the DoLatest property. |
Date |
getEndFixedDate()
get the property |
long |
getEndFixedTime()
Get the EndFixedTime property. |
int |
getEndMode()
Get the EndMode property. |
double |
getEndOffset()
Get the EndOffset property. |
double |
getInterval()
Get the Interval property. |
double[] |
getIntervalTicks()
Generate an array of times for the interval |
Date |
getNowTime()
Get the NowTime property. |
int |
getNumTimesInRange()
Get the NumTimesInRange property. |
double |
getPostRange()
Get the PostRange property. |
double |
getPostRangeToUse()
Get the post interval range to use. |
double |
getPreRange()
Get the PreRange property. |
double |
getPreRangeToUse()
Get the pre interval range to use. |
Date[] |
getRange()
Construct and return the start and end time range |
Date[] |
getRange(List<DatedThing> dataTimes)
_more_ |
double |
getRoundTo()
Get the RoundTo property. |
int |
getSkip()
Get the Skip property. |
Date |
getStartFixedDate()
get the property |
long |
getStartFixedTime()
Get the StartFixedTime property. |
int |
getStartMode()
Get the StartMode property. |
double |
getStartOffset()
Get the StartOffset property. |
List |
getTimes()
Get the Times property. |
void |
getUrlArgs(Hashtable<String,String> args)
This adds to the hashtable the set of name/value pairs that allow us to create a new DateSelection from a url argument string |
boolean |
hasCount()
Does this date selection have a valid count |
int |
hashCode()
Get the hashcode for this object |
boolean |
hasInterval()
Do we have an interval defined |
boolean |
hasPostRange()
Do we have a post range defined |
boolean |
hasPreRange()
Do we have a pre range defined |
boolean |
isAll()
Select all things |
boolean |
isLatest()
Select the most recent thing |
static void |
main(String[] cmdLineArgs)
test main |
protected Object |
makeTimeSet()
Create the time set |
static double |
roundTo(double roundTo,
double milliSeconds)
Utility to round the given seconds |
void |
setCount(int value)
Set the Count property. |
void |
setDoAll(boolean value)
Set the DoAll property. |
void |
setDoLatest(boolean value)
Set the DoLatest property. |
void |
setEndFixedTime(Date d)
set property |
void |
setEndFixedTime(long value)
Set the EndFixedTime property. |
void |
setEndMode(int value)
Set the EndMode property. |
void |
setEndOffset(double value)
Set the EndOffset property. |
void |
setInterval(double value)
Set the Interval property. |
void |
setIntervalRange(double value)
A utility method to set the pre and post range symmetrically. |
void |
setNowTime(Date value)
Set the NowTime property. |
void |
setNumTimesInRange(int value)
Set the NumTimesInRange property. |
void |
setPostRange(double value)
Set the PostRange property. |
void |
setPreRange(double value)
Set the PreRange property. |
void |
setRoundTo(double value)
Set the RoundTo property. |
void |
setSkip(int value)
Set the Skip property. |
void |
setStartFixedTime(Date d)
set property |
void |
setStartFixedTime(long value)
Set the StartFixedTime property. |
void |
setStartMode(int value)
Set the StartMode property. |
void |
setStartOffset(double value)
Set the StartOffset property. |
void |
setTimes(List value)
Set the Times property. |
String |
toString()
tostring |
String |
toUrlString()
Create a url string to encode this object |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ARG_STARTMODE
public static final String ARG_ENDMODE
public static final String ARG_STARTFIXEDTIME
public static final String ARG_ENDFIXEDTIME
public static final String ARG_STARTOFFSET
public static final String ARG_ENDOFFSET
public static final String ARG_POSTRANGE
public static final String ARG_PRERANGE
public static final String ARG_INTERVAL
public static final String ARG_ROUNDTO
public static final String ARG_COUNT
public static final String ARG_SKIP
public boolean debug
public static final int TIMEMODE_FIXED
public static final int TIMEMODE_CURRENT
public static final int TIMEMODE_RELATIVE
public static final int TIMEMODE_DATA
public static String[] TIMEMODESTRINGS
public static int[] TIMEMODES
public static String[] STARTMODELABELS
public static String[] ENDMODELABELS
public static final int MAX_COUNT
Constructor Detail |
---|
public DateSelection()
public DateSelection(Hashtable<String,String> args)
args
- set of name value pairs as created by getUrlArgspublic DateSelection(boolean doLatest, int count)
doLatest
- Do the count latest onescount
- the countpublic DateSelection(boolean doAll)
doAll
- Get all available.public DateSelection(int startMode, double startOffset, int endMode, double endOffset)
startMode
- starting time modestartOffset
- offset from start timeendMode
- end time modeendOffset
- offset from end timepublic DateSelection(Date startTime, Date endTime)
startTime
- start timeendTime
- end timepublic DateSelection(DateSelection that)
that
- object to copy fromMethod Detail |
---|
public double[] getIntervalTicks()
public List apply(List times)
times
- input list of DatedThing-s
public Date[] getRange()
public Date[] getRange(List<DatedThing> dataTimes)
dataTimes
- _more_
public static double roundTo(double roundTo, double milliSeconds)
roundTo
- round tomilliSeconds
- time to round
protected Object makeTimeSet()
public void setStartMode(int value)
value
- The new value for StartModepublic int getStartMode()
public void setEndMode(int value)
value
- The new value for EndModepublic int getEndMode()
public boolean hasInterval()
public boolean hasPreRange()
public boolean hasPostRange()
public void setInterval(double value)
value
- The new value for Intervalpublic double getInterval()
public void setStartOffset(double value)
value
- The new value for StartOffsetpublic double getStartOffset()
public void setEndOffset(double value)
value
- The new value for EndOffsetpublic double getEndOffset()
public void setRoundTo(double value)
value
- The new value for RoundTopublic double getRoundTo()
public void setStartFixedTime(long value)
value
- The new value for StartFixedTimepublic void setStartFixedTime(Date d)
d
- propertypublic void setEndFixedTime(Date d)
d
- propertypublic Date getStartFixedDate()
public Date getEndFixedDate()
public long getStartFixedTime()
public void setEndFixedTime(long value)
value
- The new value for EndFixedTimepublic long getEndFixedTime()
public void setIntervalRange(double value)
value
- interval rangepublic void setPreRange(double value)
value
- The new value for PreRangepublic double getPreRangeToUse()
public double getPostRangeToUse()
public double getPreRange()
public void setPostRange(double value)
value
- The new value for PostRangepublic double getPostRange()
public void setCount(int value)
value
- The new value for Countpublic boolean hasCount()
public int getCount()
public void setNumTimesInRange(int value)
value
- The new value for NumTimesInRangepublic int getNumTimesInRange()
public void setTimes(List value)
value
- The new value for Timespublic List getTimes()
public int hashCode()
hashCode
in class Object
public boolean equals(Object o)
equals
in class Object
o
- object to check
public void setSkip(int value)
value
- The new value for Skippublic int getSkip()
public void setDoLatest(boolean value)
value
- The new value for DoLatestpublic boolean isLatest()
public boolean getDoLatest()
public void setDoAll(boolean value)
value
- The new value for DoAllpublic boolean isAll()
public boolean getDoAll()
public void setNowTime(Date value)
value
- The new value for NowTimepublic Date getNowTime()
public static void main(String[] cmdLineArgs) throws Exception
cmdLineArgs
- cmd line args
Exception
- on badnesspublic String toString()
toString
in class Object
public void getUrlArgs(Hashtable<String,String> args)
args
- put the name value pairs in herepublic String toUrlString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |