Package hec.model

Class RunTimeStep

java.lang.Object
hec.model.RunTimeStep

public class RunTimeStep extends Object
Represents the active time step within a RunTimeWindow
  • Field Details

    • rtw

      public RunTimeWindow rtw
    • step

      public int step
    • flag

      public int flag
    • nstep

      public int nstep
  • Constructor Details

    • RunTimeStep

      public RunTimeStep()
      create a new RunTimeStep
    • RunTimeStep

      public RunTimeStep(RunTimeStep rts)
      create a new RunTimeStep initialized to rts
      Parameters:
      rts - the RunTimeStep to initialize to
    • RunTimeStep

      public RunTimeStep(RunTimeWindow runTimeWindow)
      create a new RunTimeStep initialized to runTimeWindow with a step of 0 and number of steps of 1
      Parameters:
      runTimeWindow - the runTimeWindow
  • Method Details

    • isPerAvgTimeStep

      public boolean isPerAvgTimeStep()
    • init

      public void init(RunTimeStep rts)
      initialize the RunTimeStep to rts
      Parameters:
      rts - the RunTimeStep to initialze to
    • getTotalNumSteps

      public int getTotalNumSteps()
      get the total number of steps from the RunTimeWindow
      Returns:
      the total number of steps
    • setStep

      public void setStep(int i)
      set the current step
      Parameters:
      i - the new current step
    • getStep

      public int getStep()
      get the current time step index
      Returns:
      the current time step index
    • getPrevStep

      public int getPrevStep()
      get the previous time step index. If current step is zero, returns 0.
      Returns:
      the previous time step index
    • increment

      public void increment()
      increment the current step by 1
    • getTimeStepSeconds

      public int getTimeStepSeconds()
      get the time step in seconds
      Returns:
      the time step in seconds, if the RunTimeWindow is null return 1
    • getTimeStepMinutes

      public int getTimeStepMinutes()
      get the time step in minutes
      Returns:
      the time step in minutes, if the RunTimeWindow is null return 1
    • dateTimeString

      public String dateTimeString()
      get the date and time at the current step as a String
      Returns:
      the date and time at the current step as a String
    • dateTimeString

      public String dateTimeString(int theStep)
      get the date and time at theStep.
      Parameters:
      theStep - the step to get the date time at
      Returns:
      the date time and step or the step if the RunTimeWindow is null
    • month

      public int month()
      get the month at the current step
      Returns:
      the month at the current step or 1 if the RunTimeWindow is null
    • hecJulian

      public int hecJulian()
      get the julian date at the current step
      Returns:
      the julian date at the current step or 1 if the RunTimeWindow is null
    • hecMinutes

      public int hecMinutes()
      get the minutes since midnight for the current step
      Returns:
      the minutes since midnight for the current step or 1 if the RunTimeWindow is null
    • getHecTime

      public HecTime getHecTime()
      get the time at the current step
      Returns:
      the time at the current step or null if the RunTimeWindow is null
    • getDayOfWeek

      public int getDayOfWeek()
      return the zero based integer day of week where 0000 hours belongs to the previous day. Sunday returns 0, Saturday return 6.
      Returns:
      integer day of week
    • getDayOfWeek

      public static int getDayOfWeek(HecTime htime)
      return the zero based integer day of week where 0000 hours belongs to the previous day. Sunday returns 0, Saturday return 6.
      Returns:
      integer day of week
    • valueMinutes

      public int valueMinutes()
      return the time step value in minutes
      Returns:
      integer time step value in minutes
    • getRunTimeWindow

      public RunTimeWindow getRunTimeWindow()
      get the RunTimeWindow
      Returns:
      the RunTimeWindow