Class ScheduleSpec

java.lang.Object
com.espertech.esper.common.internal.schedule.ScheduleSpec

public final class ScheduleSpec extends Object
Holds a schedule specification which consists of a set of integer values or a null value for each schedule unit to indicate a wildcard. There is always an element in the specification for each unit minutes, hours, day of month, month, and day of week. There is optionally an element in the specification for the unit seconds.
  • Field Details

  • Constructor Details

  • Method Details

    • make

      public CodegenExpression make(CodegenMethodScope parent, CodegenClassScope classScope)
    • getOptionalDayOfMonthOperator

      public CronParameter getOptionalDayOfMonthOperator()
    • getOptionalDayOfWeekOperator

      public CronParameter getOptionalDayOfWeekOperator()
    • setOptionalDayOfMonthOperator

      public void setOptionalDayOfMonthOperator(CronParameter optionalDayOfMonthOperator)
    • setOptionalDayOfWeekOperator

      public void setOptionalDayOfWeekOperator(CronParameter optionalDayOfWeekOperator)
    • setOptionalTimeZone

      public void setOptionalTimeZone(String optionalTimeZone)
    • getUnitValues

      public final EnumMap<ScheduleUnit,SortedSet<Integer>> getUnitValues()
      Return map of ordered set of valid schedule values for minute, hour, day, month etc. units
      Returns:
      map of 5 or 6 entries each with a set of integers
    • getOptionalTimeZone

      public String getOptionalTimeZone()
    • addValue

      public final void addValue(ScheduleUnit element, int value)
      For unit testing, add a single value, changing wildcards to value sets.
      Parameters:
      element - to add
      value - to add
    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • equals

      public final boolean equals(Object otherObject)
      Overrides:
      equals in class Object
    • hashCode

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

      protected static void compress(Map<ScheduleUnit,SortedSet<Integer>> unitValues)
      Function to reduce value sets for unit that cover the whole range down to a wildcard. I.e. reduce 0,1,2,3,4,5,6 for week value to 'null' indicating the wildcard.
      Parameters:
      unitValues - is the set of valid values per unit
    • validate

      protected static void validate(Map<ScheduleUnit,SortedSet<Integer>> unitValues)
      Validate units and their value sets.
      Parameters:
      unitValues - is the set of valid values per unit