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