Package org.glassfish.common.util.timer
Class TimerSchedule
java.lang.Object
org.glassfish.common.util.timer.TimerSchedule
- All Implemented Interfaces:
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:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct TimerSchedule instance with all defaults.Construct TimerSchedule instance from a given String. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidPopulate all internale structures to be used for the next timeout calculationsdayOfMonth(String d) booleangetEnd()getHour()getMonth()Returns the Date of the next possible timeout.getNextTimeout(Date date) Returns the Date of the next possible timeout after the specific date.getStart()getYear()inthashCode()protected booleanisExpectedElementCount(String[] el) Validate number of elements in the input stringbooleanReturns true if this date can be used for the next timeout of the schedule represented by this instance.
-
Constructor Details
-
TimerSchedule
public TimerSchedule()Construct TimerSchedule instance with all defaults. -
TimerSchedule
Construct TimerSchedule instance from a given String.
-
-
Method Details
-
second
-
getSecond
-
minute
-
getMinute
-
hour
-
getHour
-
dayOfMonth
-
getDayOfMonth
-
month
-
getMonth
-
dayOfWeek
-
getDayOfWeek
-
year
-
getYear
-
timezone
-
getTimeZoneID
-
getTimeZone
-
start
-
getStart
-
end
-
getEnd
-
getScheduleAsString
-
hashCode
public int hashCode() -
equals
-
isValid
Returns true if this date can be used for the next timeout of the schedule represented by this instance. -
getNextTimeout
Returns the Date of the next possible timeout. -
getNextTimeout
Returns the Date of the next possible timeout after the specific date. -
isExpectedElementCount
Validate number of elements in the input string -
configure
protected void configure()Populate all internale structures to be used for the next timeout calculations
-