The Java EE 6 Tutorial, Volume I

Specifying a Range of Values

Use a dash character (-) to specify an inclusive range of values for an attribute. Members of a range cannot be wildcards, lists, or intervals. If the range is of the form x-x, it is equivalent to the single-valued expression x. If the range is of the form x-y and x is greater than y, it is equivalent to the expression x-maximum value, minimum value-y. That is, the expression begins at x, rolls-over to the beginning of the allowable values, and continues up to y.

Example 16–11 Calendar Expressions Using Ranges

The following expression represents 9:00 AM to 5:00 PM:


The following expression represents Friday through Monday:


The following expression represents the 25th day of the month to the end of the month, and the beginning of the month to the 5th day of the month:


It is equivalent to the following expression: