Package hec.model

Class SeasonalPairedValues

java.lang.Object
hec.model.PairedValuesExt
hec.model.SeasonalPairedValues
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, Serializable, Cloneable

public class SeasonalPairedValues extends PairedValuesExt implements AsciiSerializable
Extends the PairedValuesExt class to use the paired values curve labels to store date/time
See Also:
  • Constructor Details

    • SeasonalPairedValues

      public SeasonalPairedValues()
  • Method Details

    • setGmtOffset

      public void setGmtOffset(int offset)
    • getGmtOffset

      public int getGmtOffset()
      Returns the time zone that this data is defined for.
    • scaleValues

      public void scaleValues(double scl)
    • clone

      public SeasonalPairedValues clone()
      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.
      Overrides:
      clone in class PairedValuesExt
    • init

      public void init()
      Description copied from class: PairedValuesExt
      initialize the PairedValueExt object. validate that the data is valid and that the xvalues and yvalues are continuously increasing sequences
      Overrides:
      init in class PairedValuesExt
    • makeLeapYearTimeArray

      protected boolean makeLeapYearTimeArray()
    • setTimeInterpolationType

      public void setTimeInterpolationType(int type)
      set type of interpolation in time
    • getTimeInterpolationType

      public int getTimeInterpolationType()
    • setData

      public boolean setData(PairedDataContainer pdc)
      set x-ordinates and multiple yvalue curves. Times are assumed to be contained in the PairedDataContainer curve labels.
      Overrides:
      setData in class PairedValuesExt
      Parameters:
      pdc - the PairedDataContainer to copy the data from
      Returns:
      true
    • setData

      public void setData(SeasonalRecord sr)
      Develop a SeasonalPairedValues object from a SeasonalRecord
    • setData

      public void setData(PairedValues pv, String startDate)
      Develop a one curve SeasonalPairedValues object from a PairedValues object
    • getPairedValues

      public PairedValues getPairedValues()
      Return a PairedValues object developed from the first SeasonalPairedValues curve
    • getTimeArray

      public int[] getTimeArray()
    • setArrays

      public void setArrays(double[] xArray, double[][] yArrays, int[] timeArray)
      set xvalues, single or multiple yvalue curves, and times (as int julian minutes)
    • clearValues

      public void clearValues()
      empty data arrays ( but not _dataVector
      Overrides:
      clearValues in class PairedValuesExt
    • setHasSeasonalVariation

      public void setHasSeasonalVariation(boolean tf)
      Set use seasonal variation. If no seasonal variation, then just the first y-value curve is used for interpolation, etc.
    • hasSeasonalVariation

      public boolean hasSeasonalVariation()
    • interpolate

      public double interpolate(RunTimeStep runtime, double xval)
      Interpolate in time and function x-value
    • interpolate

      public double interpolate(HecTime htime, double xval)
      Interpolate in time and function x-value
    • interpolate

      public double interpolate(RunTime runtime, double xval)
      Interpolate in time and function x-value
    • interpolate

      public double interpolate(int interpTime, double xval)
      Interpolate in time and function x-value
    • findTimeInterval

      public int findTimeInterval(int rundate)
      find interval time for interpolation
    • resetWaterYearStart

      public boolean resetWaterYearStart(String waterYearStart)
    • getDateString

      public static String getDateString(int minutes)
      Convert a julian time ( minutes ) into a string of DDMMM
    • getJulianMinute

      public static int getJulianMinute(String dateStr)
    • getJulianMinute

      public static int getJulianMinute(String dateStr, int startYear)
    • main

      public static void main(String[] args)
    • getTime

      public int getTime(int id)
      returns the time at the specified array location
    • getYears

      public int getYears()
      get the length of the seasonal record (years)
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from class: PairedValuesExt
      required AsciiSerialized method. publicially callable only because of an implementation detail. Should not be called by anything other than the AsciiSerializer
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class PairedValuesExt
      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 class: PairedValuesExt
      required AsciiSerialized method. publicially callable only because of an implementation detail. Should not be called by anything other than the AsciiDeserializer
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class PairedValuesExt
      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