1 /* GENERATED SOURCE. DO NOT MODIFY. */
2 // © 2016 and later: Unicode, Inc. and others.
3 // License & terms of use: http://www.unicode.org/copyright.html#License
4 /*
5  *******************************************************************************
6  * Copyright (C) 1996-2010, International Business Machines Corporation and    *
7  * others. All Rights Reserved.                                                *
8  *******************************************************************************
9  */
10 
11 package android.icu.util;
12 
13 import java.util.Date;
14 
15 /**
16  * <b>Note:</b> The Holiday framework is a technology preview.
17  * Despite its age, is still draft API, and clients should treat it as such.
18  *
19  * DateRule is an interface for calculating the date of an event.
20  * It supports both recurring events and those which occur only once.
21  * DateRule is useful for storing information about holidays,
22  * Daylight Savings Time rules, and other events such as meetings.
23  *
24  * @see SimpleDateRule
25  * @hide Only a subset of ICU is exposed in Android
26  * @hide draft / provisional / internal are hidden on Android
27  */
28 public interface DateRule
29 {
30     /**
31      * Return the first occurrance of the event represented by this rule
32      * that is on or after the given start date.
33      *
34      * @param start Only occurrances on or after this date are returned.
35      *
36      * @return      The date on which this event occurs, or null if it
37      *              does not occur on or after the start date.
38      *
39      * @see #firstBetween
40      * @hide draft / provisional / internal are hidden on Android
41      */
firstAfter(Date start)42     abstract public Date    firstAfter(Date start);
43 
44     /**
45      * Return the first occurrance of the event represented by this rule
46      * that is on or after the given start date and before the given
47      * end date.
48      *
49      * @param start Only occurrances on or after this date are returned.
50      * @param end   Only occurrances before this date are returned.
51      *
52      * @return      The date on which this event occurs, or null if it
53      *              does not occur between the start and end dates.
54      *
55      * @see #firstAfter
56      * @hide draft / provisional / internal are hidden on Android
57      */
firstBetween(Date start, Date end)58     abstract public Date    firstBetween(Date start, Date end);
59 
60     /**
61      * Checks whether this event occurs on the given date.  This does
62      * <em>not</em> take time of day into account; instead it checks
63      * whether this event and the given date are on the same day.
64      * This is useful for applications such as determining whether a given
65      * day is a holiday.
66      *
67      * @param date  The date to check.
68      * @return      true if this event occurs on the given date.
69      * @hide draft / provisional / internal are hidden on Android
70      */
isOn(Date date)71     abstract public boolean isOn(Date date);
72 
73     /**
74      * Check whether this event occurs at least once between the two
75      * dates given.
76      * @hide draft / provisional / internal are hidden on Android
77      */
isBetween(Date start, Date end)78     abstract public boolean isBetween(Date start, Date end);
79 }
80