Class TableGlobalVariable

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, GlobalVariable, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class TableGlobalVariable extends BaseGlobalVariable
See Also:
  • Constructor Details

    • TableGlobalVariable

      public TableGlobalVariable()
    • TableGlobalVariable

      public TableGlobalVariable(RssSystem network)
  • Method Details

    • clone

      public TableGlobalVariable clone()
      Description copied from class: NamedType
      Creates 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:
      clone in interface GlobalVariable
      Overrides:
      clone in class BaseGlobalVariable
    • getType

      public GlobalVariableType getType()
      get the type of the GlobalVariable
      Returns:
      GlobalVariableType.TABLE
    • getDSSFilename

      public String getDSSFilename()
      get the DSS file
      Returns:
      the DSS File or null
    • getDSSPathname

      public String getDSSPathname()
      get the DSS path
      Returns:
      the DSS path or null
    • getTable

      public Object 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 a hec.model.SeasonalRecord, otherwise a hec.model.PairedValues
      • TableType.TWOVARIABLELOOKUP: if its seasonal data then hec.model.SeasonalPairedValues, otherwise a hec.model.PairedValuesExt
      • TableType.REPORT: hec.model.PairedValuesExt
      Returns:
      the table data
    • getPairedDataContainer

      public PairedDataContainer getPairedDataContainer()
      Returns:
    • setTable

      public void setTable(PairedDataContainer pdc)
      set the output TableGlobalVariable's table data with the PairedDataContainer object
      Parameters:
      pdc - the new table values
    • setTable

      public void setTable(PairedValues pv)
      set the output TableGlobalVariable's table data with the PairedValues object. This is for TableGlobalVariables with the Table Type of TableType.SIMPLELOOKUPTABLE
      Parameters:
      pv - the new table values
    • setTable

      public void setTable(PairedValuesExt pve)
      set the output TableGlobalVariable's table data with the PairedValuesExt object. This is for TableGlobalVariables with the Table Type of TableType.TWOVARIABLELOOKUP and TableType.REPORT
      Parameters:
      pve - the new table values
    • getTableType

      public TableType getTableType()
      get the type of the TableGlobalVariable
      Returns:
      one of TableType.SIMPLELOOKUPTABLE, TableType.TWOVARIABLELOOKUP or TableType.REPORT
      See Also:
    • getTableTypeAsString

      public String 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

      public void setTableType(TableType tableType)
    • 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

      public String getXParameter()
      get the X parameter for the TableGlobalVariable
      Returns:
      the X Parameter or null if there are none defined
    • getZParameter

      public String getZParameter()
      get the second Y parameter for the TableGlobalVariable
      Returns:
      the Y Parameter or null if there are none defined
    • getYParameter

      public String 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

      public String getYParameter(int index)
      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

      public List<String> 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

      public void setXParameter(String xParam)
      set the X Parameter for the Output TableGlobalVariable
      Parameters:
      xParam - the new X parameter.
    • setYParameter

      public void setYParameter(String yParam)
      set the Y Parameter for the Output TableGlobalVariable
      Parameters:
      yParam - the new Y parameter.
    • setYParameters

      public void setYParameters(String[] yParams)
      set the Y Parameter for the Output TableGlobalVariable
      Parameters:
      yParams - the new Y parameter.
    • getIndependentList

      public List<NameValuePair<String>> getIndependentList()
      Returns:
    • setIndependentList

      public void setIndependentList(List<NameValuePair<String>> independentList)
    • getDependentList

      public List<NameValuePair<String>> getDependentList()
      Returns:
    • setDependentList

      public void setDependentList(List<NameValuePair<String>> dependentList)
    • isDSS

      public boolean isDSS()
    • setIsDSS

      public void setIsDSS(boolean isDSS)
    • initializeGv

      public boolean initializeGv()
      Description copied from class: BaseGlobalVariable
      called on input global variables
      Specified by:
      initializeGv in interface GlobalVariable
      Overrides:
      initializeGv in class BaseGlobalVariable
    • getComputeMsg

      protected String getComputeMsg()
      Overrides:
      getComputeMsg in class BaseGlobalVariable
      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

      public String getDescriptiveText()
      Description copied from interface: GlobalVariable
      gets a description of the type of the global variable
      Returns:
      descriptive text
    • outputReport

      public void outputReport(AlternativeInputReport report, org.jdom.Element myElem)
      add the table global variable's information to the alternative report
      Specified by:
      outputReport in interface GlobalVariable
      Overrides:
      outputReport in class BaseGlobalVariable
      Parameters:
      report - the alternative report
      myElem - 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

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class BaseGlobalVariable
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class BaseGlobalVariable
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful