Class TimerSchedule

  • All Implemented Interfaces:
    Serializable
    Direct Known Subclasses:
    EJBTimerSchedule

    public class TimerSchedule
    extends Object
    implements Serializable
    This class converts a cron-like string to its internal representation and calculates the next timeout after the current timestamp.
    Author:
    mvatkina
    See Also:
    Serialized Form
    • Constructor Detail

      • TimerSchedule

        public TimerSchedule()
        Construct TimerSchedule instance with all defaults.
      • TimerSchedule

        public TimerSchedule​(String s)
        Construct TimerSchedule instance from a given String.
    • Method Detail

      • getSecond

        public String getSecond()
      • getMinute

        public String getMinute()
      • getHour

        public String getHour()
      • getDayOfMonth

        public String getDayOfMonth()
      • getMonth

        public String getMonth()
      • getDayOfWeek

        public String getDayOfWeek()
      • getYear

        public String getYear()
      • getTimeZoneID

        public String getTimeZoneID()
      • getTimeZone

        public TimeZone getTimeZone()
      • getStart

        public Date getStart()
      • getEnd

        public Date getEnd()
      • getScheduleAsString

        public String getScheduleAsString()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • isValid

        public boolean isValid​(Calendar date)
        Returns true if this date can be used for the next timeout of the schedule represented by this instance.
      • getNextTimeout

        public Calendar getNextTimeout()
        Returns the Date of the next possible timeout.
      • getNextTimeout

        public Calendar getNextTimeout​(Date date)
        Returns the Date of the next possible timeout after the specific date.
      • isExpectedElementCount

        protected boolean isExpectedElementCount​(String[] el)
        Validate number of elements in the input string
      • configure

        protected void configure()
        Populate all internale structures to be used for the next timeout calculations