Class DayOfMonth
- java.lang.Object
-
- org.jboss.as.ejb3.timerservice.schedule.attribute.IntegerBasedExpression
-
- org.jboss.as.ejb3.timerservice.schedule.attribute.DayOfMonth
-
public class DayOfMonth extends IntegerBasedExpression
Represents the value of a day in a month, constructed out of aScheduleExpression.getDayOfMonth()A
DayOfMonthcan hold anIntegeror aStringas its value. value. The various ways in which aDayOfMonthvalue can be represented are:- Wildcard. For example, dayOfMonth = "*"
- Range. Examples:
- dayOfMonth = "1-10"
- dayOfMonth = "Sun-Tue"
- dayOfMonth = "1st-5th"
- List. Examples:
- dayOfMonth = "1, 12, 20"
- dayOfMonth = "Mon, Fri, Sun"
- dayOfMonth = "3rd, 1st, Last"
- Single value. Examples:
- dayOfMonth = "Fri"
- dayOfMonth = "Last"
- dayOfMonth = "10"
- Version:
- $Revision: $
- Author:
- Jaikiran Pai
-
-
Field Summary
Fields Modifier and Type Field Description static IntegerMAX_DAY_OF_MONTHThe maximum allowed value for theDayOfMonthstatic IntegerMIN_DAY_OF_MONTHThe minimum allowed value for theDayOfMonthstatic PatternREGEX_SPACESRegex pattern for multiple space characters-
Fields inherited from class org.jboss.as.ejb3.timerservice.schedule.attribute.IntegerBasedExpression
absoluteValues, origValue, relativeValues, scheduleExpressionType
-
-
Constructor Summary
Constructors Constructor Description DayOfMonth(String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccepts(ScheduleExpressionType scheduleExprType)protected voidassertValid(Integer value)IntegergetFirstMatch(Calendar cal)protected IntegergetMaxValue()Returns the maximum allowed value for aDayOfMonthprotected IntegergetMinValue()Returns the minimum allowed value for aDayOfMonthIntegergetNextMatch(Calendar currentCal)booleanisRelativeValue(String value)Checks if relative value is supported.protected IntegerparseInt(String alias)-
Methods inherited from class org.jboss.as.ejb3.timerservice.schedule.attribute.IntegerBasedExpression
processIncrement, processListItem, processListValue, processRangeValue, processSingleValue
-
-
-
-
Field Detail
-
REGEX_SPACES
public static final Pattern REGEX_SPACES
Regex pattern for multiple space characters
-
MAX_DAY_OF_MONTH
public static final Integer MAX_DAY_OF_MONTH
The maximum allowed value for theDayOfMonth
-
MIN_DAY_OF_MONTH
public static final Integer MIN_DAY_OF_MONTH
The minimum allowed value for theDayOfMonth
-
-
Constructor Detail
-
DayOfMonth
public DayOfMonth(String value)
Creates aDayOfMonthby parsing the passedStringvalueValid values are of type
ScheduleExpressionType.WILDCARD,ScheduleExpressionType.RANGE,ScheduleExpressionType.LISTorScheduleExpressionType.SINGLE_VALUE- Parameters:
value- The value to be parsed- Throws:
IllegalArgumentException- If the passedvalueis neither aScheduleExpressionType.WILDCARD,ScheduleExpressionType.RANGE,ScheduleExpressionType.LIST, norScheduleExpressionType.SINGLE_VALUE.
-
-
Method Detail
-
getMaxValue
protected Integer getMaxValue()
Returns the maximum allowed value for aDayOfMonth- Specified by:
getMaxValuein classIntegerBasedExpression- See Also:
MAX_DAY_OF_MONTH
-
getMinValue
protected Integer getMinValue()
Returns the minimum allowed value for aDayOfMonth- Specified by:
getMinValuein classIntegerBasedExpression- See Also:
MIN_DAY_OF_MONTH
-
assertValid
protected void assertValid(Integer value) throws IllegalArgumentException
- Overrides:
assertValidin classIntegerBasedExpression- Throws:
IllegalArgumentException
-
isRelativeValue
public boolean isRelativeValue(String value)
Description copied from class:IntegerBasedExpressionChecks if relative value is supported.- Specified by:
isRelativeValuein classIntegerBasedExpression- Parameters:
value- non-null value- Returns:
- true if relative value is supported
-
accepts
protected boolean accepts(ScheduleExpressionType scheduleExprType)
- Specified by:
acceptsin classIntegerBasedExpression
-
parseInt
protected Integer parseInt(String alias)
- Overrides:
parseIntin classIntegerBasedExpression
-
-