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