The Java EE 6 Tutorial

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. A range of the form x–x, is equivalent to the single-valued expression x. A range of the form x–y where x is greater than y 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.

The following expression represents 9:00 a.m. to 5:00 p.m.:

hour="9–17"

The following expression represents Friday through Monday:

dayOfWeek="5–1"

The following expression represents the twenty-fifth day of the month to the end of the month, and the beginning of the month to the fifth day of the month:

dayOfMonth="25–5"

It is equivalent to the following expression:

dayOfMonth="25–Last,1–5"