Class Timer

java.lang.Object
tsl2.nano.cursus.Timer
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ETimer

public class Timer extends Object implements Serializable
Holds a start-end period and is able to walk through this period on given time-steps (see runThrough(Date, Date) - then it is a generator.
Author:
Tom
See Also:
  • Field Details

    • from

      protected Date from
    • until

      protected Date until
    • stepType

      protected int stepType
      a value given by the Calendar. E.g. Calendar.DAY_OF_MONTH.
    • stepLength

      protected int stepLength
      number of stepType for each step. If 0, the timer is only a period, not a generator
    • stepExceptions

      protected ArrayList<Integer> stepExceptions
      explizit step exceptions on given stepType to be ignored. It is defined as ArrayList, as List or Set is not Serializable and cannot be handled by JPA!
    • subTimers

      protected Set<Timer> subTimers
  • Constructor Details

    • Timer

      public Timer()
    • Timer

      public Timer(Date from, Date until)
    • Timer

      public Timer(Date from, Date until, int stepType, int stepLength, Integer... stepExceptions)
  • Method Details

    • isGenerator

      public boolean isGenerator()
      Returns:
      true, if a step-length was defined, to it can runThrough(Date, Date)
    • toString

      public String toString()
      Overrides:
      toString in class Object