Package org.quartz
Class TriggerUtils
- java.lang.Object
-
- org.quartz.TriggerUtils
-
public class TriggerUtils extends java.lang.ObjectConvenience and utility methods for working with.Triggers- Author:
- James House
- See Also:
CronTrigger,SimpleTrigger,DateBuilder
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.DatecomputeEndTimeToAllowParticularNumberOfFirings(OperableTrigger trigger, Calendar cal, int numTimes)Compute theDatethat is 1 second after the Nth firing of the givenTrigger, taking the trigger's associatedCalendarinto consideration.static java.util.List<java.util.Date>computeFireTimes(OperableTrigger trigger, Calendar cal, int numTimes)Returns a list of Dates that are the next fire times of aTrigger.static java.util.List<java.util.Date>computeFireTimesBetween(OperableTrigger trigger, Calendar cal, java.util.Date from, java.util.Date to)Returns a list of Dates that are the next fire times of aTriggerthat fall within the given date range.
-
-
-
Method Detail
-
computeFireTimes
public static java.util.List<java.util.Date> computeFireTimes(OperableTrigger trigger, Calendar cal, int numTimes)
Returns a list of Dates that are the next fire times of aTrigger. The input trigger will be cloned before any work is done, so you need not worry about its state being altered by this method.- Parameters:
trigger- The trigger upon which to do the workcal- The calendar to apply to the trigger's schedulenumTimes- The number of next fire times to produce- Returns:
- List of java.util.Date objects
-
computeEndTimeToAllowParticularNumberOfFirings
public static java.util.Date computeEndTimeToAllowParticularNumberOfFirings(OperableTrigger trigger, Calendar cal, int numTimes)
Compute theDatethat is 1 second after the Nth firing of the givenTrigger, taking the trigger's associatedCalendarinto consideration. The input trigger will be cloned before any work is done, so you need not worry about its state being altered by this method.- Parameters:
trigger- The trigger upon which to do the workcal- The calendar to apply to the trigger's schedulenumTimes- The number of next fire times to produce- Returns:
- the computed Date, or null if the trigger (as configured) will not fire that many times.
-
computeFireTimesBetween
public static java.util.List<java.util.Date> computeFireTimesBetween(OperableTrigger trigger, Calendar cal, java.util.Date from, java.util.Date to)
Returns a list of Dates that are the next fire times of aTriggerthat fall within the given date range. The input trigger will be cloned before any work is done, so you need not worry about its state being altered by this method.NOTE: if this is a trigger that has previously fired within the given date range, then firings which have already occurred will not be listed in the output List.
- Parameters:
trigger- The trigger upon which to do the workcal- The calendar to apply to the trigger's schedulefrom- The starting date at which to find fire timesto- The ending date at which to stop finding fire times- Returns:
- List of java.util.Date objects
-
-