public class SeasonalRecordExt extends java.lang.Object implements AsciiSerializable, java.lang.Cloneable
| Constructor and Description |
|---|
SeasonalRecordExt()
create a new SeasonalRecordExt
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSeasonalRecord(SeasonalRecord sr)
Inserts the SeasonalRecord sr into the ArrayList of SeasonalRecords
List is ordered by ascending curve value
|
void |
clear()
empty record of all data
|
java.lang.Object |
clone()
Creates a new object of the same class as this object.
|
int |
findInterval(int rundate)
find interval time for interpolation
|
java.lang.String[] |
getCurveLabels()
get the curve labels
|
double[] |
getCurveLabelValues()
get the curve label values
|
double[][] |
getDataArray()
get the multiple sets of y-values
|
DSSIdentifier |
getDSSIdentifier() |
java.lang.Object |
getFieldObject(java.lang.reflect.Field fld)
required AsciiSerialized method.
|
int |
getGmtOffset()
Returns the time zone that this data is defined for.
|
int |
getInterpolationType()
get the interpolation type to use.
|
int |
getNumberCurves()
get the number of SeasonalRecords
|
int |
getParameterId()
Returns the parameter id for the "double" data values.
|
java.lang.String |
getParamIdString()
get the String that represents the parameterId.
|
java.util.List<SeasonalRecord> |
getSeasonalRecordsList() |
int |
getTime(int id)
returns the time at the specified array location
|
int[] |
getTimeArray()
return the times values as
hec.heclib.util.HecTime values |
java.lang.String |
getUnitsString()
get the units string for the data.
|
int |
getUnitSystem()
Returns the unit system that this data is defined in or hec.data.Units.UNDEF_ID if no unit system has been set
|
int |
getYears()
get the length of the seasonal record (years)
|
void |
init() |
double |
interpolate(HecTime htime,
double zvalue)
Interpolate of value based on time and zvalue
|
double |
interpolate(RunTimeStep runtime,
double zvalue)
interpolate a value at the given time based on the default interpolation method
|
int |
parseString(java.lang.String param) |
void |
removeCurve(int index)
Removes an entire curve from the set of curves located at
|
void |
setArrays(int[] timeArray,
double[][] dataArray,
double[] curveValues)
set the seasonal arrays with data.
|
void |
setArrays(int[] timeArray,
double[][] dataArray,
java.lang.String[] curveLabels)
set the seasonal arrays with data.
|
void |
setArrays(int[] timeArray,
double[] dataArray,
java.lang.String curveLabel)
set the seasonal arrays with data.
|
void |
setArrays(java.lang.Object[][] values)
fill the arrays with values
the array is expected to have the form
[date1][y1]
or
[date1][y11][y12]... |
void |
setArrays(java.lang.String[] dateTimeArray,
double[][] dataArray,
double[] curveValues)
set the seasonal arrays with data.
|
void |
setArrays(java.lang.String[] dateTimeArray,
double[][] dataArray,
java.lang.String[] curveLabels)
set the seasonal arrays with data.
|
void |
setArrays(java.lang.String[] dateTimeArray,
double[] dataArray,
java.lang.String curveLabel) |
void |
setCurveLabels(double[] curveValues)
set the curve labels.
|
void |
setCurveLabels(java.lang.String[] labels)
set the curve labels, the labels should be convertible to numeric values.
|
void |
setDSSIdentifier(DSSIdentifier dssId)
set the DSSIdentifier.
|
boolean |
setFieldObject(java.lang.reflect.Field fld,
java.lang.Object fobj)
required AsciiSerialized method.
|
void |
setGmtOffset(int offset)
set the offset from GMT
|
void |
setInterpolationType(int type)
set the interpolation type to use.
|
void |
setParameterId(int parameterId)
Sets the parameter ID for the double values in this record.
|
void |
setUnitSystem(int us)
set the unit system.
|
int |
size()
return number of x-values
|
java.lang.String |
toString() |
public SeasonalRecordExt()
public void setParameterId(int parameterId)
parameterId - the parameter id. for flow the parameter would be hec.data.Parameter.PARAMID_FLOWParameterpublic int getParameterId()
Parameterpublic void setUnitSystem(int us)
hec.data.Units.SI_ID or hec.data.Units.ENGLISH_ID
the data is not converted on a change of unit systemus - one of hec.data.Units.SI_ID or hec.data.Units.ENGLISH_IDpublic void setGmtOffset(int offset)
offset - the GMT offsetpublic int getUnitSystem()
hec.data.Units.SI,
hec.data.Units.ENGLISH or if not set hec.data.Units.UNDEFINED_UNITSpublic java.lang.String getUnitsString()
hec.data.Units.SI_ID,
hec.data.Units.ENGLISH_ID or if not set hec.data.Units.UNDEF_IDpublic java.lang.String getParamIdString()
public int getGmtOffset()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic void init()
public void setInterpolationType(int type)
type - one of SeasonalRecord.INTERP_LINEAR_ID
SeasonalRecord.INTERP_CUBIC_ID SeasonalRecord.INTERP_STEP_IDpublic int getInterpolationType()
SeasonalRecord.INTERP_LINEAR_ID
SeasonalRecord.INTERP_CUBIC_ID SeasonalRecord.INTERP_STEP_IDpublic int[] getTimeArray()
hec.heclib.util.HecTime valuespublic double[][] getDataArray()
public java.util.List<SeasonalRecord> getSeasonalRecordsList()
public void setCurveLabels(java.lang.String[] labels)
labels - the labels for the curvespublic void setCurveLabels(double[] curveValues)
curveValues - the labels for the curvespublic void setArrays(java.lang.Object[][] values)
[date1][y1]
[date2][y2]
[date3][y3]
[date4][y4]
[date5][y5]
[date1][y11][y12]...
[date2][y21][y22]...
[date3][y31][y32]...
[date4][y41][y42]...
[date5][y51][y52]...
This method will also take a Jython tuple defined like so:
table=(
["01Jan1900, 1200", 10,20,30,40],
["15Jan1900, 1200", 3500,5000,7000,9000],
["30Jan1900, 1200", 10000,12000,15000,20000],
["04Feb1900, 1700", 3500, 4500, 6000, 8000])
values - the seasonal valuespublic void setArrays(int[] timeArray,
double[][] dataArray,
double[] curveValues)
timeArray - the date/times in hec.heclib.util.HecTime valuedataArray - the data arrayscurveValues - the curve valuespublic void setArrays(int[] timeArray,
double[][] dataArray,
java.lang.String[] curveLabels)
timeArray - the date/times in hec.heclib.util.HecTime valuedataArray - the data arrayscurveValues - the curve valuespublic void setArrays(int[] timeArray,
double[] dataArray,
java.lang.String curveLabel)
timeArray - the date/times in hec.heclib.util.HecTime valuedataArray - the data arrayscurveValues - the curve valuespublic void setArrays(java.lang.String[] dateTimeArray,
double[][] dataArray,
double[] curveValues)
timeArray - the date/times in a format hec.heclib.util.HecTime can parsedataArray - the data arrayscurveValues - the curve valuespublic void setArrays(java.lang.String[] dateTimeArray,
double[][] dataArray,
java.lang.String[] curveLabels)
timeArray - the date/times in a format hec.heclib.util.HecTime can parsedataArray - the data arrayscurveValues - the curve valuespublic void setArrays(java.lang.String[] dateTimeArray,
double[] dataArray,
java.lang.String curveLabel)
public void clear()
public double interpolate(RunTimeStep runtime, double zvalue)
runtime - the compute's RunTimeStepzvalue - the value to interpolate forpublic int findInterval(int rundate)
public java.lang.String toString()
toString in class java.lang.Objectpublic int parseString(java.lang.String param)
public int size()
public int getTime(int id)
id - the array index to get the time for.hec.heclib.util.HecTime valuepublic int getYears()
public double interpolate(HecTime htime, double zvalue)
htime - the timezvalue - the zvaluepublic int getNumberCurves()
public java.lang.String[] getCurveLabels()
public double[] getCurveLabelValues()
public void addSeasonalRecord(SeasonalRecord sr)
sr - the SeasonalRecord to insertpublic void removeCurve(int index)
index - the curve index to removepublic void setDSSIdentifier(DSSIdentifier dssId)
dssId - the DSSIdentifierpublic DSSIdentifier getDSSIdentifier()
public java.lang.Object getFieldObject(java.lang.reflect.Field fld)
getFieldObject in interface FieldAccessorfld - The field to get.public boolean setFieldObject(java.lang.reflect.Field fld,
java.lang.Object fobj)
setFieldObject in interface FieldAccessorfld - The java field object representing the member field to be setfobj - The data to set in that field