public class RunTimeWindow extends java.lang.Object implements java.io.Serializable, AsciiSerializable, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String[] |
_incrementString
time increment names setup to match HecTime
|
static int |
INCR_DAY |
static int |
INCR_HOUR |
static int |
INCR_MIN |
static int |
INCR_SEC |
| Constructor and Description |
|---|
RunTimeWindow()
contruct a new RunTimeWindow with values set to undefined
|
RunTimeWindow(HecTime start,
HecTime end,
HecTime lookback)
contruct a new RunTimeWindow with the specified times.
|
RunTimeWindow(RunTimeWindow rtw)
contruct a new RunTimeWindow from the specified RunTimeWindow
|
| Modifier and Type | Method and Description |
|---|---|
RunTimeWindow |
clone() |
boolean |
computeSteps() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getEndDateString()
get the end date (no time) as a String
|
java.lang.String |
getEndHrMinString()
get the end time (hour&minutes) as a String
|
HecTime |
getEndTime()
get the end time
|
java.lang.String |
getEndTimeString()
get the end date and time as a String
|
HecTime |
getExtractStartTime()
get the extract start time
|
java.lang.Object |
getFieldObject(java.lang.reflect.Field fld)
This method allows access to java.lang.reflect.Field objects within the implementing
class.
|
int |
getForecastSteps() |
java.lang.String |
getLookbackDateString()
get the lookback date (no time) as a String
|
java.lang.String |
getLookbackHrMinString()
get the look back time (hours&minutes) as a String
|
HecTime |
getLookbackTime()
get the look back time
|
java.lang.String |
getLookbackTimeString()
get the lookback date and time as a String
|
int |
getNumberOfYears()
return the number of whole years in the runtimewindow
|
double |
getNumberOfYearsWithFraction()
return the number of years in the runtimewindow with any fractional part in the decimal
|
int |
getNumLookbackSteps()
get the number of lookback steps in the RunTimeWindow
|
int |
getNumRoutingSteps()
return the number of routing steps
|
int |
getNumSteps()
get the number of steps in the RunTimeWindow
|
RunTimeStep |
getRunTimeStepAtTime(HecTime time)
get the RunTimeStep at time for this RunTimeWindow
|
java.lang.String |
getStartDateString()
get the start date as a String
|
java.lang.String |
getStartHrMinString()
get the start time (hour minutes) as a String
|
HecTime |
getStartTime()
get the start time
|
java.lang.String |
getStartTimeString()
get the start date time as a String
|
int |
getStepAtTime(HecTime time)
get the step at time.
|
HecTime |
getTimeAtStep(int i)
gets the time at step i
|
int |
getTimeBlockIndex() |
int |
getTimeIncrement()
get the time increment, one of
HecTime.SECOND_INCREMENT,
HecTime.MINUTE_INCREMENT, HecTime.HOUR_INCREMENT,
or HecTime.DAY_INCREMENT |
java.lang.String |
getTimeIncrementString()
return the string representation of the time increment.
|
int |
getTimeStep()
get the time step
|
static int[] |
getTimeStep(java.lang.String str)
get the time step and time step increment for the timestep string
|
int |
getTimeStepMinutes()
get the time step in seconds
|
int |
getTimeStepSeconds()
get the time step in seconds
|
static int |
getTimeStepSeconds(int timeStep,
int timeStepIncrement)
given the time step and time step increment return the time step in seconds
|
java.lang.String |
getTimeStepString(int format)
get the time step value and units as a string (for example 1HOUR)
|
static java.lang.String |
getTimeStepString(int timeStep,
int timeIncrement) |
java.lang.String |
getTimeStringAtStep(int timeStep)
get the time at step timeStep as a String
|
java.lang.String |
getTimeWindowString()
get a string representation of the time window from lookback to end time.
|
int |
hashCode() |
boolean |
isPerAvgTimeStep() |
boolean |
isValid()
check to see if the RunTimeWindow is value
|
static void |
main(java.lang.String[] args) |
void |
set(java.lang.String times)
set the times of the runtimewindow.
|
void |
setEndTime(HecTime end)
set the end time
|
void |
setEndTime(java.lang.String timestr)
set the end time
|
boolean |
setFieldObject(java.lang.reflect.Field fld,
java.lang.Object fobj)
This allows access to fields withing the implementing object to set there data.
|
void |
setLookbackTime(HecTime lookback)
set the lookback time
|
void |
setLookbackTime(java.lang.String timestr)
set the lookback time
|
void |
setNumLookbackSteps(int numSteps)
set the number of lookback steps
|
void |
setNumRoutingSteps(int numSteps)
set the number of routing steps
|
void |
setPeriodAvgTimeStep(boolean b) |
void |
setShowTimeAsBeginningOfDay(boolean b) |
void |
setStartTime(HecTime start)
set the start time
|
void |
setStartTime(java.lang.String timestr)
set the start time
|
void |
setTimeBlockIndex(int index) |
void |
setTimeStep(int dt,
int inc)
set the time step
|
void |
setTimeStep(java.lang.String str)
set the time step and time increment by a string
|
java.lang.String |
toString()
return the string representation of the RunTimeWindow
|
public static final java.lang.String[] _incrementString
public static final int INCR_SEC
public static final int INCR_MIN
public static final int INCR_HOUR
public static final int INCR_DAY
public RunTimeWindow()
public RunTimeWindow(HecTime start, HecTime end, HecTime lookback)
start - the start timeend - the end timelookback - the lookback timepublic RunTimeWindow(RunTimeWindow rtw)
rtw - the RunTimeWindow to initialize frompublic void setShowTimeAsBeginningOfDay(boolean b)
public boolean isPerAvgTimeStep()
public void setPeriodAvgTimeStep(boolean b)
public int getTimeBlockIndex()
public void setTimeBlockIndex(int index)
public int getNumRoutingSteps()
public void setNumRoutingSteps(int numSteps)
numSteps - public boolean isValid()
public int getNumSteps()
RMAConst.UNDEF_INT if the RunTimeWindow isn't validpublic void setNumLookbackSteps(int numSteps)
numSteps - the number of lookback stepspublic int getNumLookbackSteps()
RMAConst.UNDEF_INT if the RunTimeWindow isn't validpublic int getForecastSteps()
public boolean computeSteps()
public void setTimeStep(int dt,
int inc)
dt - the timestepinc - the time increment one of HecTime.SECOND_INCREMENT,
HecTime.MINUTE_INCREMENT, HecTime.HOUR_INCREMENT,
or HecTime.DAY_INCREMENTpublic void setTimeStep(java.lang.String str)
public static int[] getTimeStep(java.lang.String str)
str - the timestep string i.e. 1 HOUR or 1HOURpublic static int getTimeStepSeconds(int timeStep,
int timeStepIncrement)
timeStep - the time steptimeStepIncrement - the time step increment (i.e. HecTime.HOUR_INCREMENT)public int getTimeStep()
public int getTimeStepSeconds()
public int getTimeStepMinutes()
public int getTimeIncrement()
HecTime.SECOND_INCREMENT,
HecTime.MINUTE_INCREMENT, HecTime.HOUR_INCREMENT,
or HecTime.DAY_INCREMENTpublic java.lang.String getTimeIncrementString()
public java.lang.String getTimeStepString(int format)
format - 0 no space between time step and time increment (1HOUR) 1 space between time step and time increment (1 HOUR)public java.lang.String getTimeWindowString()
public void setStartTime(HecTime start)
start - the new start timepublic void setStartTime(java.lang.String timestr)
timestr - a date time string that is parsable be HecTimepublic HecTime getStartTime()
public java.lang.String getStartDateString()
public java.lang.String getStartHrMinString()
public java.lang.String getStartTimeString()
public void setEndTime(HecTime end)
end - the new end timepublic void setEndTime(java.lang.String timestr)
timestr - a date time string that is parsable by HecTimepublic HecTime getEndTime()
public java.lang.String getEndDateString()
public java.lang.String getEndHrMinString()
public java.lang.String getEndTimeString()
public void setLookbackTime(HecTime lookback)
lookback - the new lookback timepublic void setLookbackTime(java.lang.String timestr)
timestr - a date time string that is parsable by HecTimepublic HecTime getLookbackTime()
public java.lang.String getLookbackDateString()
public java.lang.String getLookbackHrMinString()
public java.lang.String getLookbackTimeString()
public RunTimeStep getRunTimeStepAtTime(HecTime time)
time - the time to get the RunTimeStep forpublic HecTime getTimeAtStep(int i)
i - the time step to get the time atpublic int getStepAtTime(HecTime time)
time - the HecTime to get the step forpublic java.lang.String getTimeStringAtStep(int timeStep)
timeStep - the timeStep to get the time forpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object getFieldObject(java.lang.reflect.Field fld)
FieldAccessorgetFieldObject in interface FieldAccessorfld - The field to get.public boolean setFieldObject(java.lang.reflect.Field fld,
java.lang.Object fobj)
FieldAccessorsetFieldObject in interface FieldAccessorfld - The java field object representing the member field to be setfobj - The data to set in that fieldpublic static void main(java.lang.String[] args)
public static java.lang.String getTimeStepString(int timeStep,
int timeIncrement)
tstep - timeIncrement - public void set(java.lang.String times)
times should be 1 or more HecTime compatible strings separated
by semicolons. i.e. 20Jan1999 1400;
the order of parsing is if there are 3 times then the first is the lookback
then the start and then the end
if there are 2 times then its considered the start and end
if there is just 1 time then its considered the start time.times - public int getNumberOfYears()
public double getNumberOfYearsWithFraction()
public HecTime getExtractStartTime()
public RunTimeWindow clone()
clone in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object