public abstract class GeoTemporalApplicability extends Object implements GeoTemporalPredicate
Temporal in a GeoRegion.| Constructor and Description |
|---|
GeoTemporalApplicability() |
| Modifier and Type | Method and Description |
|---|---|
static GeoTemporalApplicability |
holiday(EnumSet<HolidayType> types)
Creates an applicability satisfied on holidays of any of the given types.
|
static GeoTemporalApplicability |
parse(String expression)
Creates an applicability satisfied when the given expression evaluates to
true. |
static GeoTemporalApplicability |
publicHoliday()
Creates an applicability satisfied on public holidays.
|
static GeoTemporalApplicability |
schoolHoliday()
Creates an applicability satisfied on school holidays.
|
abstract boolean |
test(Temporal temporal,
GeoRegion region)
Checks whether this applicability is satisfied at the given temporal in the given region.
|
static GeoTemporalApplicability |
weekend()
Creates an applicability satisfied on weekends.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitand, negate, orpublic static GeoTemporalApplicability holiday(EnumSet<HolidayType> types)
public static GeoTemporalApplicability parse(String expression)
true.
The expression must be a Boolean expression composed of a combination of the Boolean constants "true" and "false", temporal predicates (see below), Boolean operators "and", "or", and "not", and parentheses "(" and ")".
| Example | Meaning |
|---|---|
(singleMonth[Sep] or singleMonth[Dec]) and singleDayOfWeek[Sat] |
Saturdays in September and December |
monthDayRange[10-15,10-29] and singleDayOfWeek[Fri] |
Fridays between 15 October and 29 October (both dates inclusive) |
| Syntax | Description | Example | Meaning |
|---|---|---|---|
dateRange[YYYY-MM-DD,YYYY-MM-DD] |
range of dates (see TemporalApplicability.dateRange(LocalDate, LocalDate)) |
dateRange[2015-10-15,2015-10-29] |
15 October 2015 to 29 October 2015 |
dayOfWeekAfter[N,U,MM-DD] |
nth day-of-week after a month-day (see TemporalApplicability.dayOfWeekAfter(int, DayOfWeek, MonthDay)) |
dayOfWeekAfter[4,Thu,10-31] |
fourth Thursday after 31 October, fourth Thursday in November |
dayOfWeekBefore[N,U,MM-DD] |
nth day-of-week before a month-day (see TemporalApplicability.dayOfWeekBefore(int, DayOfWeek, MonthDay)) |
dayOfWeekBefore[1,Sun,12-25] |
first Sunday before 25 December |
dayOfWeekRange[U,U] |
range of days-of-week (see TemporalApplicability.dayOfWeekRange(DayOfWeek, DayOfWeek)) |
dayOfWeekRange[Fri,Sun] |
Friday to Sunday |
false |
never (see TemporalApplicability.never()) |
false |
never |
holiday[T...] |
holiday of any of the given types (see holiday(EnumSet)) |
holiday[P] |
public holidays |
isoWeek[even] |
weeks with even ISO week number (see TemporalApplicability.evenIsoWeek()) |
isoWeek[even] |
weeks with even ISO week number |
isoWeek[odd] |
weeks with odd ISO week number (see TemporalApplicability.oddIsoWeek()) |
isoWeek[odd] |
weeks with odd ISO week number |
isoWeekRange[W,W] |
weeks with ISO week numbers from the given range (see TemporalApplicability.isoWeekRange(int, int)) |
isoWeekRange[5,9] |
weeks with ISO week numbers 5 to 9 |
monthDayRange[MM-DD,MM-DD] |
range of month-days (see TemporalApplicability.monthDayRange(MonthDay, MonthDay)) |
monthDayRange[10-15,10-29] |
15 October to 29 October |
monthRange[MM,MM] |
range of months-of-year (see TemporalApplicability.monthRange(Month, Month)) |
monthRange[10,12] |
October to December |
publicHoliday[] |
single date (see publicHoliday()) |
publicHoliday[] |
public holidays |
schoolHoliday[] |
single date (see schoolHoliday()) |
schoolHoliday[] |
school holidays |
singleDate[YYYY-MM-DD] |
single date (see TemporalApplicability.singleDate(LocalDate)) |
singleDate[2015-10-15] |
15 October 2015 |
singleDayOfWeek[U] |
single day-of-week (see TemporalApplicability.singleDayOfWeek(DayOfWeek)) |
singleDayOfWeek[Fri] |
Friday |
singleIsoWeek[W] |
weeks with ISO week number (see TemporalApplicability.singleIsoWeek(int)) |
singleIsoWeek[42] |
weeks with ISO week number 42 |
singleMonth[MM] |
single month-of-year (see TemporalApplicability.singleMonth(Month)) |
singleMonth[10] |
October |
singleMonthDay[MM-DD] |
single month-day (see TemporalApplicability.singleMonthDay(MonthDay)) |
singleMonthDay[10-15] |
15 October |
singleYear[YYYY] |
single year (see TemporalApplicability.singleYear(int)) |
singleYear[2015] |
2015 |
true |
always (see TemporalApplicability.always()) |
true |
always |
yearRange[YYYY,YYYY] |
range of years (see TemporalApplicability.yearRange(int, int)) |
year[2014,2015] |
2014 to 2015 |
| Constant | Meaning |
|---|---|
| B | holidays observed only by banks and (most) financial institutions (see HolidayType.BANKS_AND_FINANCIAL_INSTITUTIONS_ONLY) |
| G | holidays observed only by government services (see HolidayType.GOVERNMENT_SERVICES_ONLY) |
| P | holidays observed globally (see HolidayType.PUBLIC) |
| S | holidays observed only by schools (see HolidayType.SCHOOLS_ONLY) |
| U | holidays observed only by schools and universities (see HolidayType.SCHOOLS_AND_UNIVERSITIES_ONLY) |