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