Class ScheduleSpec
java.lang.Object
com.espertech.esper.common.internal.schedule.ScheduleSpec
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 Summary
-
Constructor Summary
ConstructorDescriptionConstructor - for unit testing, initialize to all wildcards but leave seconds empty.ScheduleSpec
(EnumMap<ScheduleUnit, SortedSet<Integer>> unitValues, String optionalTimeZone, CronParameter optionalDayOfMonthOperator, CronParameter optionalDayOfWeekOperator) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addValue
(ScheduleUnit element, int value) For unit testing, add a single value, changing wildcards to value sets.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.final boolean
final EnumMap<ScheduleUnit,
SortedSet<Integer>> Return map of ordered set of valid schedule values for minute, hour, day, month etc.int
hashCode()
make
(CodegenMethodScope parent, CodegenClassScope classScope) void
setOptionalDayOfMonthOperator
(CronParameter optionalDayOfMonthOperator) void
setOptionalDayOfWeekOperator
(CronParameter optionalDayOfWeekOperator) void
setOptionalTimeZone
(String optionalTimeZone) final String
toString()
protected static void
validate
(Map<ScheduleUnit, SortedSet<Integer>> unitValues) Validate units and their value sets.
-
Field Details
-
EPTYPE
-
-
Constructor Details
-
ScheduleSpec
public ScheduleSpec(EnumMap<ScheduleUnit, SortedSet<Integer>> unitValues, String optionalTimeZone, CronParameter optionalDayOfMonthOperator, CronParameter optionalDayOfWeekOperator) throws IllegalArgumentException- Throws:
IllegalArgumentException
-
ScheduleSpec
public ScheduleSpec()Constructor - for unit testing, initialize to all wildcards but leave seconds empty.
-
-
Method Details
-
make
-
getOptionalDayOfMonthOperator
-
getOptionalDayOfWeekOperator
-
setOptionalDayOfMonthOperator
-
setOptionalDayOfWeekOperator
-
setOptionalTimeZone
-
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
-
addValue
For unit testing, add a single value, changing wildcards to value sets.- Parameters:
element
- to addvalue
- to add
-
toString
-
equals
-
hashCode
public int hashCode() -
compress
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
Validate units and their value sets.- Parameters:
unitValues
- is the set of valid values per unit
-