Package hec.rss.model.globalvariable
Class TableGlobalVariable
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.rss.model.globalvariable.BaseGlobalVariable
hec.rss.model.globalvariable.TableGlobalVariable
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,GlobalVariable,Serializable,Cloneable,Comparable,Observer,rma.lang.Modifiable
- See Also:
-
Field Summary
Fields inherited from class hec.rss.model.globalvariable.BaseGlobalVariable
_altGvData, _networkFields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a new object of the same class as this object.protected Stringgets a description of the type of the global variableget the DSS fileget the DSS pathgetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.longintget the number of dependent parameters for the TableGlobalVariableintget the number of independent parameters for the TableGlobalVariableintget the number of rows in the tableintget the number of values (rows) in the tableintget the number of Y valuesintget the number of Y columns in the dataintget the number of values (rows) in the tablegetTable()returns the appropriate table type for the table global variable.get the type of the TableGlobalVariableget the type of the TableGlobalVariable as a StringgetType()get the type of the GlobalVariableget the X parameter for the TableGlobalVariabledouble[]get the X valuesget the second Y parameter for the TableGlobalVariable that are TableType.TWOVARIABLELOOKUP.getYParameter(int index) get the Y parameter for the TableGlobalVariable specified by the indexreturn the Y Parameters as a List of Stringsdouble[]returns the array of values of the second independent variable for a lookup table with two independent variables.double[]getYValues(int curveNumber) return the Y Parameters as a List of Stringsget the second Y parameter for the TableGlobalVariablebooleancalled on input global variablesbooleanisDSS()booleanis the GlobalVariableTable a Report table typebooleanis this Table's data seasonalvoidoutputReport(AlternativeInputReport report, org.jdom.Element myElem) add the table global variable's information to the alternative reportvoidsetDependentList(List<NameValuePair<String>> dependentList) booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetIndependentList(List<NameValuePair<String>> independentList) voidsetIsDSS(boolean isDSS) voidsetModifiedTime(long modifiedTime) voidsetSeasonalData(boolean seasonalData) voidset the output TableGlobalVariable's table data with the PairedDataContainer objectvoidsetTable(PairedValues pv) set the output TableGlobalVariable's table data with the PairedValues object.voidsetTable(PairedValuesExt pve) set the output TableGlobalVariable's table data with the PairedValuesExt object.voidsetTableType(TableType tableType) voidsetXParameter(String xParam) set the X Parameter for the Output TableGlobalVariablevoidsetXValues(double[] xvalues) set the xvalues for the tablevoidsetYParameter(String yParam) set the Y Parameter for the Output TableGlobalVariablevoidsetYParameters(String[] yParams) set the Y Parameter for the Output TableGlobalVariablevoidsetYValues(double[][] yvalues) set the Y Values for the table .Methods inherited from class hec.rss.model.globalvariable.BaseGlobalVariable
finalizeCompute, getIsDataLocation, getNetwork, getUsageType, hasValidValue, isInput, printToComputeLog, printToComputeWindow, setGlobalVariableData, setInput, setIsDataLocationMethods inherited from class hec.lang.NamedType
addModifiableListener, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isModified, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setIgnoreModifiedEvents, setIndex, setModified, setName, setValid, toString, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChangedMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface hec.rss.model.globalvariable.GlobalVariable
getDescription, getIndex, getName, setDescription, setIndex, setName
-
Constructor Details
-
TableGlobalVariable
public TableGlobalVariable() -
TableGlobalVariable
-
-
Method Details
-
clone
Description copied from class:NamedTypeCreates a new object of the same class as this object.
It then initializes each of the new object's fields by assigning it the same value as the corresponding field in this object. No
constructor is called.- Specified by:
clonein interfaceGlobalVariable- Overrides:
clonein classBaseGlobalVariable
-
getType
get the type of the GlobalVariable- Returns:
- GlobalVariableType.TABLE
-
getDSSFilename
get the DSS file- Returns:
- the DSS File or null
-
getDSSPathname
get the DSS path- Returns:
- the DSS path or null
-
getTable
returns the appropriate table type for the table global variable. the object types that are returned are:TableType.SIMPLELOOKUPTABLE: if its seasonal data then ahec.model.SeasonalRecord, otherwise ahec.model.PairedValuesTableType.TWOVARIABLELOOKUP: if its seasonal data thenhec.model.SeasonalPairedValues, otherwise ahec.model.PairedValuesExtTableType.REPORT:hec.model.PairedValuesExt
- Returns:
- the table data
-
getPairedDataContainer
- Returns:
-
setTable
set the output TableGlobalVariable's table data with the PairedDataContainer object- Parameters:
pdc- the new table values
-
setTable
set the output TableGlobalVariable's table data with the PairedValues object. This is for TableGlobalVariables with the Table Type ofTableType.SIMPLELOOKUPTABLE- Parameters:
pv- the new table values
-
setTable
set the output TableGlobalVariable's table data with the PairedValuesExt object. This is for TableGlobalVariables with the Table Type ofTableType.TWOVARIABLELOOKUPandTableType.REPORT- Parameters:
pve- the new table values
-
getTableType
get the type of the TableGlobalVariable- Returns:
- one of
TableType.SIMPLELOOKUPTABLE,TableType.TWOVARIABLELOOKUPorTableType.REPORT - See Also:
-
getTableTypeAsString
get the type of the TableGlobalVariable as a String- Returns:
- one of
"Simple Lookup Table","Two-Variable Lookup Table"or"Report" - See Also:
-
isReportTable
public boolean isReportTable()is the GlobalVariableTable a Report table type- Returns:
- true if the getTableType() returns
TableType.REPORT
-
setTableType
-
getNumDependentParameters
public int getNumDependentParameters()get the number of dependent parameters for the TableGlobalVariable- Returns:
- the number of dependent parameters
-
getNumIndependentParameters
public int getNumIndependentParameters()get the number of independent parameters for the TableGlobalVariable- Returns:
- the number of independent parameters
-
getNumYParameters
public int getNumYParameters()get the number of Y columns in the data- Returns:
- 1 for SIMPLELOOKUPTABLE invalid input: '&' TWOVARIABLELOOKUP, and the number of dependent parameters for the REPORT
-
getNumYCurves
public int getNumYCurves()get the number of Y values- Returns:
- the number of rows in the Y data. 0 for a REPORT table, -1 if there is no Y data.
-
getNumRows
public int getNumRows()get the number of rows in the table- Returns:
- the number of rows in the table.-1 if there is an error or no data found
-
getXParameter
get the X parameter for the TableGlobalVariable- Returns:
- the X Parameter or null if there are none defined
-
getZParameter
get the second Y parameter for the TableGlobalVariable- Returns:
- the Y Parameter or null if there are none defined
-
getYParameter
get the second Y parameter for the TableGlobalVariable that are TableType.TWOVARIABLELOOKUP. get the first Y parameter for the TableGlobalVariable that are TableType.REPORT or TableType.SIMPLELOOKUPTABLE- Returns:
- the Y Parameter or null if there are none defined
-
getYParameter
get the Y parameter for the TableGlobalVariable specified by the index- Returns:
- the Y Parameter at index position or null if there are none defined or index is invalid
-
getYParameterValues
public double[] getYParameterValues()returns the array of values of the second independent variable for a lookup table with two independent variables.- Returns:
-
getYParameters
return the Y Parameters as a List of Strings- Returns:
- the Y Parameters
-
getYValues
public double[] getYValues(int curveNumber) return the Y Parameters as a List of Strings- Returns:
- the Y Parameters or null if there is an error or invalid curve number
-
getXValues
public double[] getXValues()get the X values- Returns:
- the X values or null if there is no data
-
getNumXValues
public int getNumXValues()get the number of values (rows) in the table- Returns:
- the number of rows in the table.-1 if there is an error or no data found
-
getNumYValues
public int getNumYValues()get the number of values (rows) in the table- Returns:
- the number of rows in the table.-1 if there is an error or no data found
-
setXParameter
set the X Parameter for the Output TableGlobalVariable- Parameters:
xParam- the new X parameter.
-
setYParameter
set the Y Parameter for the Output TableGlobalVariable- Parameters:
yParam- the new Y parameter.
-
setYParameters
set the Y Parameter for the Output TableGlobalVariable- Parameters:
yParams- the new Y parameter.
-
getIndependentList
- Returns:
-
setIndependentList
-
getDependentList
- Returns:
-
setDependentList
-
isDSS
public boolean isDSS() -
setIsDSS
public void setIsDSS(boolean isDSS) -
initializeGv
public boolean initializeGv()Description copied from class:BaseGlobalVariablecalled on input global variables- Specified by:
initializeGvin interfaceGlobalVariable- Overrides:
initializeGvin classBaseGlobalVariable
-
getComputeMsg
- Overrides:
getComputeMsgin classBaseGlobalVariable- Returns:
-
setSeasonalData
public void setSeasonalData(boolean seasonalData) - Parameters:
seasonalData-
-
isSeasonalData
public boolean isSeasonalData()is this Table's data seasonal- Returns:
-
setModifiedTime
public void setModifiedTime(long modifiedTime) - Parameters:
modifiedTime-
-
getModifiedTime
public long getModifiedTime() -
getDescriptiveText
Description copied from interface:GlobalVariablegets a description of the type of the global variable- Returns:
- descriptive text
-
outputReport
add the table global variable's information to the alternative report- Specified by:
outputReportin interfaceGlobalVariable- Overrides:
outputReportin classBaseGlobalVariable- Parameters:
report- the alternative reportmyElem- the element for this global variable
-
setXValues
public void setXValues(double[] xvalues) set the xvalues for the table- Parameters:
xvalues- the new xvalues
-
setYValues
public void setYValues(double[][] yvalues) set the Y Values for the table .- Parameters:
yvalues- the new yvalues
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classBaseGlobalVariable- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin classBaseGlobalVariable- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-