public class DateUtilities extends Object
Modifier and Type | Method and Description |
---|---|
static Long |
calculateInitialDelay(long period,
String baseTimeVal,
SimpleDateFormat df)
Computes the number of milliseconds for the initial delay, from
a BaseTimeOfDay setting, which may include a date.
|
static Long |
convertTimerInterval(String value)
Computes the number of milliseconds in a period of time specified
as a string.
|
static Long |
convertTimerInterval(String value,
long defValue)
Computes the number of milliseconds in a period of time specified
as a string, and default to the specified value if the specified
string is not legal or is null.
|
static Long |
convertTimerInterval(String value,
String daySuffix,
String hourSuffix,
String minuteSuffix,
String secondSuffix)
Computes the number of milliseconds in a period of time specified
as a string.
|
static void |
verifyTimeOfDayString(String value)
Verified a specification of a time-of-day.
|
public static Long convertTimerInterval(String value) throws IfsException
For example, convert "36s" to new Long(36000).
value
- string value to be convertedIfsException
- if the operation failspublic static Long convertTimerInterval(String value, long defValue)
value
- string value to be converteddefValue
- string value to be convertedIfsException
- if the operation failspublic static Long convertTimerInterval(String value, String daySuffix, String hourSuffix, String minuteSuffix, String secondSuffix) throws IfsException
For example, convert "36s" to 36000 ms.
value
- string value to be converteddaySuffix
- suffix used for dayhourSuffix
- suffix used for hourminuteSuffix
- suffix used for minutesecondSuffix
- suffix used for secondIfsException
- if the operation failspublic static void verifyTimeOfDayString(String value) throws IfsException
Verifies that the string specified represents a 24-hour time specification.
value
- string value to be checkedIfsException
- if the operation failspublic static Long calculateInitialDelay(long period, String baseTimeVal, SimpleDateFormat df) throws IfsException
This delay is based on the current time, the specified base time, and the specified Period. The returned delay will never be greater than the specified period.
period
- cycle period (in ms)baseTimeVal
- base time string valuedf
- DateFormatter to use for the translationIfsException
- (IFS-45349) if the operation failsCopyright © 2023. All rights reserved.