~ubuntu-branches/ubuntu/gutsy/icu/gutsy-updates

« back to all changes in this revision

Viewing changes to source/i18n/unicode/calendar.h

  • Committer: Package Import Robot
  • Author(s): Jay Berkenbilt
  • Date: 2005-11-19 11:29:31 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20051119112931-vcizkrp10tli4enw
Tags: 3.4-3
Explicitly build with g++ 3.4.  The current ICU fails its test suite
with 4.0 but not with 3.4.  Future versions should work properly with
4.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
********************************************************************************
3
 
*   Copyright (C) 1997-1999, International Business Machines
4
 
*   Corporation and others.  All Rights Reserved.
5
 
********************************************************************************
6
 
*
7
 
* File CALENDAR.H
8
 
*
9
 
* Modification History:
10
 
*
11
 
*   Date        Name        Description
12
 
*   04/22/97    aliu        Expanded and corrected comments and other header
13
 
*                           contents.
14
 
*   05/01/97    aliu        Made equals(), before(), after() arguments const.
15
 
*   05/20/97    aliu        Replaced fAreFieldsSet with fAreFieldsInSync and
16
 
*                           fAreAllFieldsSet.
17
 
*   07/27/98    stephen     Sync up with JDK 1.2
18
 
*   11/15/99    weiv        added YEAR_WOY and DOW_LOCAL
19
 
*                           to EDateFields
20
 
********************************************************************************
21
 
*/
22
 
 
23
 
#ifndef CALENDAR_H
24
 
#define CALENDAR_H
25
 
 
26
 
#include "unicode/locid.h"
27
 
#include "unicode/timezone.h"
28
 
 
29
 
U_NAMESPACE_BEGIN
30
 
 
31
 
/**
32
 
 * <code>Calendar</code> is an abstract base class for converting between
33
 
 * a <code>UDate</code> object and a set of integer fields such as
34
 
 * <code>YEAR</code>, <code>MONTH</code>, <code>DAY</code>, <code>HOUR</code>,
35
 
 * and so on. (A <code>UDate</code> object represents a specific instant in
36
 
 * time with millisecond precision. See
37
 
 * {@link UDate}
38
 
 * for information about the <code>UDate</code> class.)
39
 
 *
40
 
 * <p>
41
 
 * Subclasses of <code>Calendar</code> interpret a <code>UDate</code>
42
 
 * according to the rules of a specific calendar system. The JDK
43
 
 * provides one concrete subclass of <code>Calendar</code>:
44
 
 * <code>GregorianCalendar</code>. Future subclasses could represent
45
 
 * the various types of lunar calendars in use in many parts of the world.
46
 
 *
47
 
 * <p>
48
 
 * Like other locale-sensitive classes, <code>Calendar</code> provides a
49
 
 * class method, <code>getInstance</code>, for getting a generally useful
50
 
 * object of this type. <code>Calendar</code>'s <code>getInstance</code> method
51
 
 * returns a <code>GregorianCalendar</code> object whose
52
 
 * time fields have been initialized with the current date and time:
53
 
 * <blockquote>
54
 
 * <pre>
55
 
 * Calendar rightNow = Calendar.getInstance();
56
 
 * </pre>
57
 
 * </blockquote>
58
 
 *
59
 
 * <p>
60
 
 * A <code>Calendar</code> object can produce all the time field values
61
 
 * needed to implement the date-time formatting for a particular language
62
 
 * and calendar style (for example, Japanese-Gregorian, Japanese-Traditional).
63
 
 *
64
 
 * <p>
65
 
 * When computing a <code>UDate</code> from time fields, two special circumstances
66
 
 * may arise: there may be insufficient information to compute the
67
 
 * <code>UDate</code> (such as only year and month but no day in the month),
68
 
 * or there may be inconsistent information (such as "Tuesday, July 15, 1996"
69
 
 * -- July 15, 1996 is actually a Monday).
70
 
 *
71
 
 * <p>
72
 
 * <strong>Insufficient information.</strong> The calendar will use default
73
 
 * information to specify the missing fields. This may vary by calendar; for
74
 
 * the Gregorian calendar, the default for a field is the same as that of the
75
 
 * start of the epoch: i.e., YEAR = 1970, MONTH = JANUARY, DATE = 1, etc.
76
 
 *
77
 
 * <p>
78
 
 * <strong>Inconsistent information.</strong> If fields conflict, the calendar
79
 
 * will give preference to fields set more recently. For example, when
80
 
 * determining the day, the calendar will look for one of the following
81
 
 * combinations of fields.  The most recent combination, as determined by the
82
 
 * most recently set single field, will be used.
83
 
 *
84
 
 * <blockquote>
85
 
 * <pre>
86
 
 * MONTH + DAY_OF_MONTH
87
 
 * MONTH + WEEK_OF_MONTH + DAY_OF_WEEK
88
 
 * MONTH + DAY_OF_WEEK_IN_MONTH + DAY_OF_WEEK
89
 
 * DAY_OF_YEAR
90
 
 * DAY_OF_WEEK + WEEK_OF_YEAR
91
 
 * </pre>
92
 
 * </blockquote>
93
 
 *
94
 
 * For the time of day:
95
 
 *
96
 
 * <blockquote>
97
 
 * <pre>
98
 
 * HOUR_OF_DAY
99
 
 * AM_PM + HOUR
100
 
 * </pre>
101
 
 * </blockquote>
102
 
 *
103
 
 * <p>
104
 
 * <strong>Note:</strong> for some non-Gregorian calendars, different
105
 
 * fields may be necessary for complete disambiguation. For example, a full
106
 
 * specification of the historial Arabic astronomical calendar requires year,
107
 
 * month, day-of-month <em>and</em> day-of-week in some cases.
108
 
 *
109
 
 * <p>
110
 
 * <strong>Note:</strong> There are certain possible ambiguities in
111
 
 * interpretation of certain singular times, which are resolved in the
112
 
 * following ways:
113
 
 * <ol>
114
 
 *     <li> 24:00:00 "belongs" to the following day. That is,
115
 
 *          23:59 on Dec 31, 1969 &lt; 24:00 on Jan 1, 1970 &lt; 24:01:00 on Jan 1, 1970
116
 
 *
117
 
 *     <li> Although historically not precise, midnight also belongs to "am",
118
 
 *          and noon belongs to "pm", so on the same day,
119
 
 *          12:00 am (midnight) &lt; 12:01 am, and 12:00 pm (noon) &lt; 12:01 pm
120
 
 * </ol>
121
 
 *
122
 
 * <p>
123
 
 * The date or time format strings are not part of the definition of a
124
 
 * calendar, as those must be modifiable or overridable by the user at
125
 
 * runtime. Use {@link DateFormat}
126
 
 * to format dates.
127
 
 *
128
 
 * <p>
129
 
 * <code>Calendar</code> provides an API for field "rolling", where fields
130
 
 * can be incremented or decremented, but wrap around. For example, rolling the
131
 
 * month up in the date <code>December 12, <b>1996</b></code> results in
132
 
 * <code>January 12, <b>1996</b></code>.
133
 
 *
134
 
 * <p>
135
 
 * <code>Calendar</code> also provides a date arithmetic function for
136
 
 * adding the specified (signed) amount of time to a particular time field.
137
 
 * For example, subtracting 5 days from the date <code>September 12, 1996</code>
138
 
 * results in <code>September 7, 1996</code>.
139
 
 *
140
 
 * @stable
141
 
 */
142
 
class U_I18N_API Calendar {
143
 
public:
144
 
 
145
 
    /**
146
 
     * Field IDs for date and time. Used to specify date/time fields. ERA is calendar
147
 
     * specific. Example ranges given are for illustration only; see specific Calendar
148
 
     * subclasses for actual ranges.
149
 
     * @stable
150
 
     */
151
 
    enum EDateFields {
152
 
        ERA,                  // Example: 0..1
153
 
        YEAR,                 // Example: 1..big number
154
 
        MONTH,                // Example: 0..11
155
 
        WEEK_OF_YEAR,         // Example: 1..53
156
 
        WEEK_OF_MONTH,        // Example: 1..4
157
 
        DATE,                 // Example: 1..31
158
 
        DAY_OF_YEAR,          // Example: 1..365
159
 
        DAY_OF_WEEK,          // Example: 1..7
160
 
        DAY_OF_WEEK_IN_MONTH, // Example: 1..4, may be specified as -1
161
 
        AM_PM,                // Example: 0..1
162
 
        HOUR,                 // Example: 0..11
163
 
        HOUR_OF_DAY,          // Example: 0..23
164
 
        MINUTE,               // Example: 0..59
165
 
        SECOND,               // Example: 0..59
166
 
        MILLISECOND,          // Example: 0..999
167
 
        ZONE_OFFSET,          // Example: -12*U_MILLIS_PER_HOUR..12*U_MILLIS_PER_HOUR
168
 
        DST_OFFSET,           // Example: 0 or U_MILLIS_PER_HOUR
169
 
// here will go names for 'Y' and 'e'
170
 
        YEAR_WOY,  // 'Y' Example: 1..big number
171
 
        DOW_LOCAL, // 'e' Example: 1..7
172
 
        FIELD_COUNT,
173
 
 
174
 
        DAY_OF_MONTH = DATE   // Synonyms
175
 
    };
176
 
 
177
 
    /**
178
 
     * Useful constant for days of week. Note: Calendar day-of-week is 1-based. Clients
179
 
     * who create locale resources for the field of first-day-of-week should be aware of
180
 
     * this. For instance, in US locale, first-day-of-week is set to 1, i.e., SUNDAY.
181
 
     * @stable
182
 
     */
183
 
    enum EDaysOfWeek {
184
 
        SUNDAY = 1,
185
 
        MONDAY,
186
 
        TUESDAY,
187
 
        WEDNESDAY,
188
 
        THURSDAY,
189
 
        FRIDAY,
190
 
        SATURDAY
191
 
    };
192
 
 
193
 
    /**
194
 
     * Useful constants for month. Note: Calendar month is 0-based.
195
 
     * @stable
196
 
     */
197
 
    enum EMonths {
198
 
        JANUARY,
199
 
        FEBRUARY,
200
 
        MARCH,
201
 
        APRIL,
202
 
        MAY,
203
 
        JUNE,
204
 
        JULY,
205
 
        AUGUST,
206
 
        SEPTEMBER,
207
 
        OCTOBER,
208
 
        NOVEMBER,
209
 
        DECEMBER,
210
 
        UNDECIMBER
211
 
    };
212
 
 
213
 
    /**
214
 
     * Useful constants for hour in 12-hour clock. Used in GregorianCalendar.
215
 
     * @stable
216
 
     */
217
 
    enum EAmpm {
218
 
        AM,
219
 
        PM
220
 
    };
221
 
 
222
 
    /**
223
 
     * destructor
224
 
     * @stable
225
 
     */
226
 
    virtual ~Calendar();
227
 
 
228
 
    /**
229
 
     * Create and return a polymorphic copy of this calendar.
230
 
     * @stable
231
 
     */
232
 
    virtual Calendar* clone(void) const = 0;
233
 
 
234
 
    /**
235
 
     * Creates a Calendar using the default timezone and locale. Clients are responsible
236
 
     * for deleting the object returned.
237
 
     *
238
 
     * @param success  Indicates the success/failure of Calendar creation. Filled in
239
 
     *                 with U_ZERO_ERROR if created successfully, set to a failure result
240
 
     *                 otherwise.
241
 
     * @return         A Calendar if created successfully. NULL otherwise.
242
 
     * @stable
243
 
     */
244
 
    static Calendar* createInstance(UErrorCode& success);
245
 
 
246
 
    /**
247
 
     * Creates a Calendar using the given timezone and the default locale.
248
 
     * The Calendar takes ownership of zoneToAdopt; the
249
 
     * client must not delete it.
250
 
     *
251
 
     * @param zoneToAdopt  The given timezone to be adopted.
252
 
     * @param success      Indicates the success/failure of Calendar creation. Filled in
253
 
     *                     with U_ZERO_ERROR if created successfully, set to a failure result
254
 
     *                     otherwise.
255
 
     * @return             A Calendar if created successfully. NULL otherwise.
256
 
     * @stable
257
 
     */
258
 
    static Calendar* createInstance(TimeZone* zoneToAdopt, UErrorCode& success);
259
 
 
260
 
    /**
261
 
     * Creates a Calendar using the given timezone and the default locale.  The TimeZone
262
 
     * is _not_ adopted; the client is still responsible for deleting it.
263
 
     *
264
 
     * @param zone  The timezone.
265
 
     * @param success      Indicates the success/failure of Calendar creation. Filled in
266
 
     *                     with U_ZERO_ERROR if created successfully, set to a failure result
267
 
     *                     otherwise.
268
 
     * @return             A Calendar if created successfully. NULL otherwise.
269
 
     * @stable
270
 
     */
271
 
    static Calendar* createInstance(const TimeZone& zone, UErrorCode& success);
272
 
 
273
 
    /**
274
 
     * Creates a Calendar using the default timezone and the given locale.
275
 
     *
276
 
     * @param aLocale  The given locale.
277
 
     * @param success  Indicates the success/failure of Calendar creation. Filled in
278
 
     *                 with U_ZERO_ERROR if created successfully, set to a failure result
279
 
     *                 otherwise.
280
 
     * @return         A Calendar if created successfully. NULL otherwise.
281
 
     * @stable
282
 
     */
283
 
    static Calendar* createInstance(const Locale& aLocale, UErrorCode& success);
284
 
 
285
 
    /**
286
 
     * Creates a Calendar using the given timezone and given locale.
287
 
     * The Calendar takes ownership of zoneToAdopt; the
288
 
     * client must not delete it.
289
 
     *
290
 
     * @param zoneToAdopt  The given timezone to be adopted.
291
 
     * @param aLocale      The given locale.
292
 
     * @param success      Indicates the success/failure of Calendar creation. Filled in
293
 
     *                     with U_ZERO_ERROR if created successfully, set to a failure result
294
 
     *                     otherwise.
295
 
     * @return             A Calendar if created successfully. NULL otherwise.
296
 
     * @stable
297
 
     */
298
 
    static Calendar* createInstance(TimeZone* zoneToAdopt, const Locale& aLocale, UErrorCode& success);
299
 
 
300
 
    /**
301
 
     * Gets a Calendar using the given timezone and given locale.  The TimeZone
302
 
     * is _not_ adopted; the client is still responsible for deleting it.
303
 
     *
304
 
     * @param zone  The timezone.
305
 
     * @param aLocale      The given locale.
306
 
     * @param success      Indicates the success/failure of Calendar creation. Filled in
307
 
     *                     with U_ZERO_ERROR if created successfully, set to a failure result
308
 
     *                     otherwise.
309
 
     * @return             A Calendar if created successfully. NULL otherwise.
310
 
     * @stable
311
 
     */
312
 
    static Calendar* createInstance(const TimeZone& zoneToAdopt, const Locale& aLocale, UErrorCode& success);
313
 
 
314
 
    /**
315
 
     * Returns a list of the locales for which Calendars are installed.
316
 
     *
317
 
     * @param count  Number of locales returned.
318
 
     * @return       An array of Locale objects representing the set of locales for which
319
 
     *               Calendars are installed.  The system retains ownership of this list;
320
 
     *               the caller must NOT delete it.
321
 
     * @stable
322
 
     */
323
 
    static const Locale* getAvailableLocales(int32_t& count);
324
 
 
325
 
    /**
326
 
     * Returns the current UTC (GMT) time measured in milliseconds since 0:00:00 on 1/1/70 
327
 
     * (derived from the system time).
328
 
     *
329
 
     * @return   The current UTC time in milliseconds.
330
 
     * @stable
331
 
     */
332
 
    static UDate getNow(void);
333
 
 
334
 
    /**
335
 
     * Gets this Calendar's time as milliseconds. May involve recalculation of time due
336
 
     * to previous calls to set time field values. The time specified is non-local UTC
337
 
     * (GMT) time. Although this method is const, this object may actually be changed
338
 
     * (semantically const).
339
 
     *
340
 
     * @param status  Output param set to success/failure code on exit. If any value
341
 
     *                previously set in the time field is invalid or restricted by
342
 
     *                leniency, this will be set to an error status.
343
 
     * @return        The current time in UTC (GMT) time, or zero if the operation
344
 
     *                failed.
345
 
     * @stable
346
 
     */
347
 
    inline UDate getTime(UErrorCode& status) const { return getTimeInMillis(status); }
348
 
 
349
 
    /**
350
 
     * Sets this Calendar's current time with the given UDate. The time specified should
351
 
     * be in non-local UTC (GMT) time.
352
 
     *
353
 
     * @param date  The given UDate in UTC (GMT) time.
354
 
     * @stable
355
 
     */
356
 
    inline void setTime(UDate date, UErrorCode& status) { setTimeInMillis(date, status); }
357
 
 
358
 
    /**
359
 
     * Compares the equality of two Calendar objects. Objects of different subclasses
360
 
     * are considered unequal. This comparison is very exacting; two Calendar objects
361
 
     * must be in exactly the same state to be considered equal. To compare based on the
362
 
     * represented time, use equals() instead.
363
 
     *
364
 
     * @param that  The Calendar object to be compared with.
365
 
     * @return      True if the given Calendar is the same as this Calendar; false
366
 
     *              otherwise.
367
 
     * @stable
368
 
     */
369
 
    virtual UBool operator==(const Calendar& that) const;
370
 
 
371
 
    /**
372
 
     * Compares the inequality of two Calendar objects.
373
 
     *
374
 
     * @param that  The Calendar object to be compared with.
375
 
     * @return      True if the given Calendar is not the same as this Calendar; false
376
 
     *              otherwise.
377
 
     * @stable
378
 
     */
379
 
    UBool operator!=(const Calendar& that) const {return !operator==(that);}
380
 
 
381
 
    /**
382
 
     * Compares the Calendar time, whereas Calendar::operator== compares the equality of
383
 
     * Calendar objects.
384
 
     *
385
 
     * @param when    The Calendar to be compared with this Calendar. Although this is a
386
 
     *                const parameter, the object may be modified physically
387
 
     *                (semantically const).
388
 
     * @param status  Output param set to success/failure code on exit. If any value
389
 
     *                previously set in the time field is invalid or restricted by
390
 
     *                leniency, this will be set to an error status.
391
 
     * @return        True if the current time of this Calendar is equal to the time of
392
 
     *                Calendar when; false otherwise.
393
 
     * @stable
394
 
     */
395
 
    UBool equals(const Calendar& when, UErrorCode& status) const;
396
 
 
397
 
    /**
398
 
     * Returns true if this Calendar's current time is before "when"'s current time.
399
 
     *
400
 
     * @param when    The Calendar to be compared with this Calendar. Although this is a
401
 
     *                const parameter, the object may be modified physically
402
 
     *                (semantically const).
403
 
     * @param status  Output param set to success/failure code on exit. If any value
404
 
     *                previously set in the time field is invalid or restricted by
405
 
     *                leniency, this will be set to an error status.
406
 
     * @return        True if the current time of this Calendar is before the time of
407
 
     *                Calendar when; false otherwise.
408
 
     * @stable
409
 
     */
410
 
    UBool before(const Calendar& when, UErrorCode& status) const;
411
 
 
412
 
    /**
413
 
     * Returns true if this Calendar's current time is after "when"'s current time.
414
 
     *
415
 
     * @param when    The Calendar to be compared with this Calendar. Although this is a
416
 
     *                const parameter, the object may be modified physically
417
 
     *                (semantically const).
418
 
     * @param status  Output param set to success/failure code on exit. If any value
419
 
     *                previously set in the time field is invalid or restricted by
420
 
     *                leniency, this will be set to an error status.
421
 
     * @return        True if the current time of this Calendar is after the time of
422
 
     *                Calendar when; false otherwise.
423
 
     * @stable
424
 
     */
425
 
    UBool after(const Calendar& when, UErrorCode& status) const;
426
 
 
427
 
    /**
428
 
     * Return true if another Calendar object is equivalent to this one.  An equivalent
429
 
     * Calendar will behave exactly as this one does, but may be set to a different time.
430
 
     * @deprecated not in Java API!
431
 
     */
432
 
    virtual UBool equivalentTo(const Calendar& other) const;
433
 
 
434
 
    /**
435
 
     * UDate Arithmetic function. Adds the specified (signed) amount of time to the given
436
 
     * time field, based on the calendar's rules. For example, to subtract 5 days from
437
 
     * the current time of the calendar, call add(Calendar::DATE, -5). When adding on
438
 
     * the month or Calendar::MONTH field, other fields like date might conflict and
439
 
     * need to be changed. For instance, adding 1 month on the date 01/31/96 will result
440
 
     * in 02/29/96.
441
 
     *
442
 
     * @param field   Specifies which date field to modify.
443
 
     * @param amount  The amount of time to be added to the field, in the natural unit
444
 
     *                for that field (e.g., days for the day fields, hours for the hour
445
 
     *                field.)
446
 
     * @param status  Output param set to success/failure code on exit. If any value
447
 
     *                previously set in the time field is invalid or restricted by
448
 
     *                leniency, this will be set to an error status.
449
 
     * @stable
450
 
     */
451
 
    virtual void add(EDateFields field, int32_t amount, UErrorCode& status) = 0;
452
 
 
453
 
    /**
454
 
     * Time Field Rolling function. Rolls (up/down) a single unit of time on the given
455
 
     * time field. For example, to roll the current date up by one day, call
456
 
     * roll(Calendar::DATE, true). When rolling on the year or Calendar::YEAR field, it
457
 
     * will roll the year value in the range between getMinimum(Calendar::YEAR) and the
458
 
     * value returned by getMaximum(Calendar::YEAR). When rolling on the month or
459
 
     * Calendar::MONTH field, other fields like date might conflict and, need to be
460
 
     * changed. For instance, rolling the month up on the date 01/31/96 will result in
461
 
     * 02/29/96. Rolling up always means rolling forward in time; e.g., rolling the year
462
 
     * up on "100 BC" will result in "99 BC", for Gregorian calendar. When rolling on the
463
 
     * hour-in-day or Calendar::HOUR_OF_DAY field, it will roll the hour value in the range
464
 
     * between 0 and 23, which is zero-based.
465
 
     * <P>
466
 
     * NOTE: Do not use this method -- use roll(EDateFields, int, UErrorCode&) instead.
467
 
     *
468
 
     * @param field   The time field.
469
 
     * @param up      Indicates if the value of the specified time field is to be rolled
470
 
     *                up or rolled down. Use true if rolling up, false otherwise.
471
 
     * @param status  Output param set to success/failure code on exit. If any value
472
 
     *                previously set in the time field is invalid or restricted by
473
 
     *                leniency, this will be set to an error status.
474
 
     * @stable
475
 
     */
476
 
    void roll(EDateFields field, UBool up, UErrorCode& status);
477
 
 
478
 
    /**
479
 
     * Time Field Rolling function. Rolls by the given amount on the given
480
 
     * time field. For example, to roll the current date up by one day, call
481
 
     * roll(Calendar::DATE, +1, status). When rolling on the month or
482
 
     * Calendar::MONTH field, other fields like date might conflict and, need to be
483
 
     * changed. For instance, rolling the month up on the date 01/31/96 will result in
484
 
     * 02/29/96.  Rolling by a positive value always means rolling forward in time;
485
 
     * e.g., rolling the year by +1 on "100 BC" will result in "99 BC", for Gregorian
486
 
     * calendar. When rolling on the hour-in-day or Calendar::HOUR_OF_DAY field, it will
487
 
     * roll the hour value in the range between 0 and 23, which is zero-based.
488
 
     * <P>
489
 
     * The only difference between roll() and add() is that roll() does not change
490
 
     * the value of more significant fields when it reaches the minimum or maximum
491
 
     * of its range, whereas add() does.
492
 
     *
493
 
     * @param field   The time field.
494
 
     * @param amount  Indicates amount to roll.
495
 
     * @param status  Output param set to success/failure code on exit. If any value
496
 
     *                previously set in the time field is invalid, this will be set to
497
 
     *                an error status.
498
 
     * @stable
499
 
     */
500
 
    virtual void roll(EDateFields field, int32_t amount, UErrorCode& status) = 0;
501
 
 
502
 
    /**
503
 
     * Return the difference between the given time and the time this
504
 
     * calendar object is set to.  If this calendar is set
505
 
     * <em>before</em> the given time, the returned value will be
506
 
     * positive.  If this calendar is set <em>after</em> the given
507
 
     * time, the returned value will be negative.  The
508
 
     * <code>field</code> parameter specifies the units of the return
509
 
     * value.  For example, if <code>fieldDifference(when,
510
 
     * Calendar.MONTH)</code> returns 3, then this calendar is set to
511
 
     * 3 months before <code>when</code>, and possibly some addition
512
 
     * time less than one month.
513
 
     *
514
 
     * <p>As a side effect of this call, this calendar is advanced
515
 
     * toward <code>when</code> by the given amount.  That is, calling
516
 
     * this method has the side effect of calling <code>add(field,
517
 
     * n)</code>, where <code>n</code> is the return value.
518
 
     *
519
 
     * <p>Usage: To use this method, call it first with the largest
520
 
     * field of interest, then with progressively smaller fields.  For
521
 
     * example:
522
 
     *
523
 
     * <pre>
524
 
     * int y = cal.fieldDifference(when, Calendar.YEAR);
525
 
     * int m = cal.fieldDifference(when, Calendar.MONTH);
526
 
     * int d = cal.fieldDifference(when, Calendar.DATE);</pre>
527
 
     *
528
 
     * computes the difference between <code>cal</code> and
529
 
     * <code>when</code> in years, months, and days.
530
 
     *
531
 
     * <p>Note: <code>fieldDifference()</code> is
532
 
     * <em>asymmetrical</em>.  That is, in the following code:
533
 
     *
534
 
     * <pre>
535
 
     * cal.setTime(date1);
536
 
     * int m1 = cal.fieldDifference(date2, Calendar.MONTH);
537
 
     * int d1 = cal.fieldDifference(date2, Calendar.DATE);
538
 
     * cal.setTime(date2);
539
 
     * int m2 = cal.fieldDifference(date1, Calendar.MONTH);
540
 
     * int d2 = cal.fieldDifference(date1, Calendar.DATE);</pre>
541
 
     *
542
 
     * one might expect that <code>m1 == -m2 && d1 == -d2</code>.
543
 
     * However, this is not generally the case, because of
544
 
     * irregularities in the underlying calendar system (e.g., the
545
 
     * Gregorian calendar has a varying number of days per month).
546
 
     *
547
 
     * @param when the date to compare this calendar's time to
548
 
     * @param field the field in which to compute the result
549
 
     * @return the difference, either positive or negative, between
550
 
     * this calendar's time and <code>when</code>, in terms of
551
 
     * <code>field</code>.
552
 
     * @stable
553
 
     */
554
 
    virtual int32_t fieldDifference(UDate when, EDateFields field, UErrorCode& status);
555
 
 
556
 
    /**
557
 
     * Sets the calendar's time zone to be the one passed in. The Calendar takes ownership
558
 
     * of the TimeZone; the caller is no longer responsible for deleting it.  If the
559
 
     * given time zone is NULL, this function has no effect.
560
 
     *
561
 
     * @param value  The given time zone.
562
 
     * @stable
563
 
     */
564
 
    void adoptTimeZone(TimeZone* value);
565
 
 
566
 
    /**
567
 
     * Sets the calendar's time zone to be the same as the one passed in. The TimeZone
568
 
     * passed in is _not_ adopted; the client is still responsible for deleting it.
569
 
     *
570
 
     * @param value  The given time zone.
571
 
     * @stable
572
 
     */
573
 
    void setTimeZone(const TimeZone& zone);
574
 
 
575
 
    /**
576
 
     * Returns a reference to the time zone owned by this calendar. The returned reference
577
 
     * is only valid until clients make another call to adoptTimeZone or setTimeZone,
578
 
     * or this Calendar is destroyed.
579
 
     *
580
 
     * @return   The time zone object associated with this calendar.
581
 
     * @stable
582
 
     */
583
 
    const TimeZone& getTimeZone(void) const;
584
 
 
585
 
    /**
586
 
     * Returns the time zone owned by this calendar. The caller owns the returned object
587
 
     * and must delete it when done.  After this call, the new time zone associated
588
 
     * with this Calendar is the default TimeZone as returned by TimeZone::createDefault().
589
 
     *
590
 
     * @return   The time zone object which was associated with this calendar.
591
 
     * @stable
592
 
     */
593
 
    TimeZone* orphanTimeZone(void);
594
 
 
595
 
    /**
596
 
     * Queries if the current date for this Calendar is in Daylight Savings Time.
597
 
     *
598
 
     * @param status Fill-in parameter which receives the status of this operation.
599
 
     * @return   True if the current date for this Calendar is in Daylight Savings Time,
600
 
     *           false, otherwise.
601
 
     * @stable
602
 
     */
603
 
    virtual UBool inDaylightTime(UErrorCode& status) const = 0;
604
 
 
605
 
    /**
606
 
     * Specifies whether or not date/time interpretation is to be lenient. With lenient
607
 
     * interpretation, a date such as "February 942, 1996" will be treated as being
608
 
     * equivalent to the 941st day after February 1, 1996. With strict interpretation,
609
 
     * such dates will cause an error when computing time from the time field values
610
 
     * representing the dates.
611
 
     *
612
 
     * @param lenient  True specifies date/time interpretation to be lenient.
613
 
     *
614
 
     * @see            DateFormat#setLenient
615
 
     * @stable
616
 
     */
617
 
    void setLenient(UBool lenient);
618
 
 
619
 
    /**
620
 
     * Tells whether date/time interpretation is to be lenient.
621
 
     *
622
 
     * @return   True tells that date/time interpretation is to be lenient.
623
 
     * @stable
624
 
     */
625
 
    UBool isLenient(void) const;
626
 
 
627
 
    /**
628
 
     * Sets what the first day of the week is; e.g., Sunday in US, Monday in France.
629
 
     *
630
 
     * @param value  The given first day of the week.
631
 
     * @stable
632
 
     */
633
 
    void setFirstDayOfWeek(EDaysOfWeek value);
634
 
 
635
 
    /**
636
 
     * Gets what the first day of the week is; e.g., Sunday in US, Monday in France.
637
 
     *
638
 
     * @return   The first day of the week.
639
 
     * @stable
640
 
     */
641
 
    EDaysOfWeek getFirstDayOfWeek(void) const;
642
 
 
643
 
    /**
644
 
     * Sets what the minimal days required in the first week of the year are; For
645
 
     * example, if the first week is defined as one that contains the first day of the
646
 
     * first month of a year, call the method with value 1. If it must be a full week,
647
 
     * use value 7.
648
 
     *
649
 
     * @param value  The given minimal days required in the first week of the year.
650
 
     * @stable
651
 
     */
652
 
    void setMinimalDaysInFirstWeek(uint8_t value);
653
 
 
654
 
    /**
655
 
     * Gets what the minimal days required in the first week of the year are; e.g., if
656
 
     * the first week is defined as one that contains the first day of the first month
657
 
     * of a year, getMinimalDaysInFirstWeek returns 1. If the minimal days required must
658
 
     * be a full week, getMinimalDaysInFirstWeek returns 7.
659
 
     *
660
 
     * @return   The minimal days required in the first week of the year.
661
 
     * @stable
662
 
     */
663
 
    uint8_t getMinimalDaysInFirstWeek(void) const;
664
 
 
665
 
    /**
666
 
     * Gets the minimum value for the given time field. e.g., for Gregorian
667
 
     * DAY_OF_MONTH, 1.
668
 
     *
669
 
     * @param field  The given time field.
670
 
     * @return       The minimum value for the given time field.
671
 
     * @stable
672
 
     */
673
 
    virtual int32_t getMinimum(EDateFields field) const = 0;
674
 
 
675
 
    /**
676
 
     * Gets the maximum value for the given time field. e.g. for Gregorian DAY_OF_MONTH,
677
 
     * 31.
678
 
     *
679
 
     * @param field  The given time field.
680
 
     * @return       The maximum value for the given time field.
681
 
     * @stable
682
 
     */
683
 
    virtual int32_t getMaximum(EDateFields field) const = 0;
684
 
 
685
 
    /**
686
 
     * Gets the highest minimum value for the given field if varies. Otherwise same as
687
 
     * getMinimum(). For Gregorian, no difference.
688
 
     *
689
 
     * @param field  The given time field.
690
 
     * @return       The highest minimum value for the given time field.
691
 
     * @stable
692
 
     */
693
 
    virtual int32_t getGreatestMinimum(EDateFields field) const = 0;
694
 
 
695
 
    /**
696
 
     * Gets the lowest maximum value for the given field if varies. Otherwise same as
697
 
     * getMaximum(). e.g., for Gregorian DAY_OF_MONTH, 28.
698
 
     *
699
 
     * @param field  The given time field.
700
 
     * @return       The lowest maximum value for the given time field.
701
 
     * @stable
702
 
     */
703
 
    virtual int32_t getLeastMaximum(EDateFields field) const = 0;
704
 
 
705
 
    /**
706
 
     * Return the minimum value that this field could have, given the current date.
707
 
     * For the Gregorian calendar, this is the same as getMinimum() and getGreatestMinimum().
708
 
     *
709
 
     * The version of this function on Calendar uses an iterative algorithm to determine the
710
 
     * actual minimum value for the field.  There is almost always a more efficient way to
711
 
     * accomplish this (in most cases, you can simply return getMinimum()).  GregorianCalendar
712
 
     * overrides this function with a more efficient implementation.
713
 
     *
714
 
     * @param field the field to determine the minimum of
715
 
     * @return the minimum of the given field for the current date of this Calendar
716
 
     * @stable
717
 
     */
718
 
    int32_t getActualMinimum(EDateFields field, UErrorCode& status) const;
719
 
 
720
 
    /**
721
 
     * Return the maximum value that this field could have, given the current date.
722
 
     * For example, with the date "Feb 3, 1997" and the DAY_OF_MONTH field, the actual
723
 
     * maximum would be 28; for "Feb 3, 1996" it s 29.  Similarly for a Hebrew calendar,
724
 
     * for some years the actual maximum for MONTH is 12, and for others 13.
725
 
     *
726
 
     * The version of this function on Calendar uses an iterative algorithm to determine the
727
 
     * actual maximum value for the field.  There is almost always a more efficient way to
728
 
     * accomplish this (in most cases, you can simply return getMaximum()).  GregorianCalendar
729
 
     * overrides this function with a more efficient implementation.
730
 
     *
731
 
     * @param field the field to determine the maximum of
732
 
     * @return the maximum of the given field for the current date of this Calendar
733
 
     * @stable
734
 
     */
735
 
    int32_t getActualMaximum(EDateFields field, UErrorCode& status) const;
736
 
 
737
 
    /**
738
 
     * Gets the value for a given time field. Recalculate the current time field values
739
 
     * if the time value has been changed by a call to setTime(). Return zero for unset
740
 
     * fields if any fields have been explicitly set by a call to set(). To force a
741
 
     * recomputation of all fields regardless of the previous state, call complete().
742
 
     * This method is semantically const, but may alter the object in memory.
743
 
     *
744
 
     * @param field  The given time field.
745
 
     * @param status Fill-in parameter which receives the status of the operation.
746
 
     * @return       The value for the given time field, or zero if the field is unset,
747
 
     *               and set() has been called for any other field.
748
 
     * @stable
749
 
     */
750
 
    int32_t get(EDateFields field, UErrorCode& status) const;
751
 
 
752
 
    /**
753
 
     * Determines if the given time field has a value set. This can affect in the
754
 
     * resolving of time in Calendar. Unset fields have a value of zero, by definition.
755
 
     *
756
 
     * @return   True if the given time field has a value set; false otherwise.
757
 
     * @stable
758
 
     */
759
 
    UBool isSet(EDateFields field) const;
760
 
 
761
 
    /**
762
 
     * Sets the given time field with the given value.
763
 
     *
764
 
     * @param field  The given time field.
765
 
     * @param value  The value to be set for the given time field.
766
 
     * @stable
767
 
     */
768
 
    void set(EDateFields field, int32_t value);
769
 
 
770
 
    /**
771
 
     * Sets the values for the fields YEAR, MONTH, and DATE. Other field values are
772
 
     * retained; call clear() first if this is not desired.
773
 
     *
774
 
     * @param year   The value used to set the YEAR time field.
775
 
     * @param month  The value used to set the MONTH time field. Month value is 0-based.
776
 
     *               e.g., 0 for January.
777
 
     * @param date   The value used to set the DATE time field.
778
 
     * @stable
779
 
     */
780
 
    void set(int32_t year, int32_t month, int32_t date);
781
 
 
782
 
    /**
783
 
     * Sets the values for the fields YEAR, MONTH, DATE, HOUR_OF_DAY, and MINUTE. Other
784
 
     * field values are retained; call clear() first if this is not desired.
785
 
     *
786
 
     * @param year    The value used to set the YEAR time field.
787
 
     * @param month   The value used to set the MONTH time field. Month value is
788
 
     *                0-based. E.g., 0 for January.
789
 
     * @param date    The value used to set the DATE time field.
790
 
     * @param hour    The value used to set the HOUR_OF_DAY time field.
791
 
     * @param minute  The value used to set the MINUTE time field.
792
 
     * @stable
793
 
     */
794
 
    void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute);
795
 
 
796
 
    /**
797
 
     * Sets the values for the fields YEAR, MONTH, DATE, HOUR_OF_DAY, MINUTE, and SECOND.
798
 
     * Other field values are retained; call clear() first if this is not desired.
799
 
     *
800
 
     * @param year    The value used to set the YEAR time field.
801
 
     * @param month   The value used to set the MONTH time field. Month value is
802
 
     *                0-based. E.g., 0 for January.
803
 
     * @param date    The value used to set the DATE time field.
804
 
     * @param hour    The value used to set the HOUR_OF_DAY time field.
805
 
     * @param minute  The value used to set the MINUTE time field.
806
 
     * @param second  The value used to set the SECOND time field.
807
 
     * @stable
808
 
     */
809
 
    void set(int32_t year, int32_t month, int32_t date, int32_t hour, int32_t minute, int32_t second);
810
 
 
811
 
    /**
812
 
     * Clears the values of all the time fields, making them both unset and assigning
813
 
     * them a value of zero. The field values will be determined during the next
814
 
     * resolving of time into time fields.
815
 
     * @stable
816
 
     */
817
 
    void clear(void);
818
 
 
819
 
    /**
820
 
     * Clears the value in the given time field, both making it unset and assigning it a
821
 
     * value of zero. This field value will be determined during the next resolving of
822
 
     * time into time fields.
823
 
     *
824
 
     * @param field  The time field to be cleared.
825
 
     * @stable
826
 
     */
827
 
    void clear(EDateFields field);
828
 
 
829
 
    /**
830
 
     * Returns a unique class ID POLYMORPHICALLY. Pure virtual method. This method is to
831
 
     * implement a simple version of RTTI, since not all C++ compilers support genuine
832
 
     * RTTI. Polymorphic operator==() and clone() methods call this method.
833
 
     * <P>
834
 
     * Concrete subclasses of Calendar must implement getDynamicClassID() and also a
835
 
     * static method and data member:
836
 
     *
837
 
     *      static UClassID getStaticClassID() { return (UClassID)&fgClassID; }
838
 
     *      static char fgClassID;
839
 
     *
840
 
     * @return   The class ID for this object. All objects of a given class have the
841
 
     *           same class ID. Objects of other classes have different class IDs.
842
 
     * @stable
843
 
     */
844
 
    virtual UClassID getDynamicClassID(void) const = 0;
845
 
 
846
 
protected:
847
 
 
848
 
     /**
849
 
      * Constructs a Calendar with the default time zone as returned by
850
 
      * TimeZone::createInstance(), and the default locale.
851
 
      *
852
 
      * @param success  Indicates the status of Calendar object construction. Returns
853
 
      *                 U_ZERO_ERROR if constructed successfully.
854
 
     * @stable
855
 
      */
856
 
    Calendar(UErrorCode& success);
857
 
 
858
 
    /**
859
 
     * Copy constructor
860
 
     * @stable
861
 
     */
862
 
    Calendar(const Calendar& source);
863
 
 
864
 
    /**
865
 
     * Default assignment operator
866
 
     * @stable
867
 
     */
868
 
    Calendar& operator=(const Calendar& right);
869
 
 
870
 
    /**
871
 
     * Constructs a Calendar with the given time zone and locale. Clients are no longer
872
 
     * responsible for deleting the given time zone object after it's adopted.
873
 
     *
874
 
     * @param zoneToAdopt     The given time zone.
875
 
     * @param aLocale  The given locale.
876
 
     * @param success  Indicates the status of Calendar object construction. Returns
877
 
     *                 U_ZERO_ERROR if constructed successfully.
878
 
     * @stable
879
 
     */
880
 
    Calendar(TimeZone* zone, const Locale& aLocale, UErrorCode& success);
881
 
 
882
 
    /**
883
 
     * Constructs a Calendar with the given time zone and locale.
884
 
     *
885
 
     * @param zone     The given time zone.
886
 
     * @param aLocale  The given locale.
887
 
     * @param success  Indicates the status of Calendar object construction. Returns
888
 
     *                 U_ZERO_ERROR if constructed successfully.
889
 
     * @stable
890
 
     */
891
 
    Calendar(const TimeZone& zone, const Locale& aLocale, UErrorCode& success);
892
 
 
893
 
    /**
894
 
     * Converts Calendar's time field values to GMT as milliseconds.
895
 
     *
896
 
     * @param status  Output param set to success/failure code on exit. If any value
897
 
     *                previously set in the time field is invalid or restricted by
898
 
     *                leniency, this will be set to an error status.
899
 
     * @stable
900
 
     */
901
 
    virtual void computeTime(UErrorCode& status) = 0;
902
 
 
903
 
    /**
904
 
     * Converts GMT as milliseconds to time field values. This allows you to sync up the
905
 
     * time field values with a new time that is set for the calendar.  This method
906
 
     * does NOT recompute the time first; to recompute the time, then the fields, use
907
 
     * the method complete().
908
 
     * @stable
909
 
     */
910
 
    virtual void computeFields(UErrorCode& status) = 0;
911
 
 
912
 
    /**
913
 
     * Gets this Calendar's current time as a long.
914
 
     * @return the current time as UTC milliseconds from the epoch.
915
 
     * @stable
916
 
     */
917
 
    double getTimeInMillis(UErrorCode& status) const;
918
 
 
919
 
    /**
920
 
     * Sets this Calendar's current time from the given long value.
921
 
     * @param date the new time in UTC milliseconds from the epoch.
922
 
     * @stable
923
 
     */
924
 
    void setTimeInMillis( double millis, UErrorCode& status );
925
 
 
926
 
    /**
927
 
     * Recomputes the current time from currently set fields, and then fills in any
928
 
     * unset fields in the time field list.
929
 
     *
930
 
     * @param status  Output param set to success/failure code on exit. If any value
931
 
     *                previously set in the time field is invalid or restricted by
932
 
     *                leniency, this will be set to an error status.
933
 
     * @stable
934
 
     */
935
 
    void complete(UErrorCode& status);
936
 
 
937
 
    /**
938
 
     * Gets the value for a given time field. Subclasses can use this function to get
939
 
     * field values without forcing recomputation of time.
940
 
     *
941
 
     * @param field  The given time field.
942
 
     * @return       The value for the given time field.
943
 
     * @stable
944
 
     */
945
 
    int32_t internalGet(EDateFields field) const {return fFields[field];}
946
 
 
947
 
    /**
948
 
     * Sets the value for a given time field.  This is a fast internal method for
949
 
     * subclasses.  It does not affect the areFieldsInSync, isTimeSet, or areAllFieldsSet
950
 
     * flags.
951
 
     * @stable
952
 
     */
953
 
    void internalSet(EDateFields field, int32_t value);
954
 
 
955
 
protected:
956
 
    /**
957
 
     * The flag which indicates if the current time is set in the calendar.
958
 
     * @stable
959
 
     */
960
 
    UBool      fIsTimeSet;
961
 
 
962
 
    /**
963
 
     * True if the fields are in sync with the currently set time of this Calendar.
964
 
     * If false, then the next attempt to get the value of a field will
965
 
     * force a recomputation of all fields from the current value of the time
966
 
     * field.
967
 
     * <P>
968
 
     * This should really be named areFieldsInSync, but the old name is retained
969
 
     * for backward compatibility.
970
 
     * @stable
971
 
     */
972
 
    UBool      fAreFieldsSet;
973
 
 
974
 
    /**
975
 
     * True if all of the fields have been set.  This is initially false, and set to
976
 
     * true by computeFields().
977
 
     * @stable
978
 
     */
979
 
    UBool      fAreAllFieldsSet;
980
 
 
981
 
    /**
982
 
     * Get the current time without recomputing.
983
 
     * @stable
984
 
     */
985
 
    UDate        internalGetTime(void) const     { return fTime; }
986
 
 
987
 
    /**
988
 
     * Set the current time without affecting flags or fields.
989
 
     * @stable
990
 
     */
991
 
    void        internalSetTime(UDate time)     { fTime = time; }
992
 
 
993
 
    /**
994
 
     * The time fields containing values into which the millis is computed.
995
 
     * @stable
996
 
     */
997
 
    int32_t     fFields[FIELD_COUNT];
998
 
 
999
 
    /**
1000
 
     * The flags which tell if a specified time field for the calendar is set.
1001
 
     * @stable
1002
 
     */
1003
 
    UBool      fIsSet[FIELD_COUNT];
1004
 
 
1005
 
    /** Special values of stamp[]
1006
 
     * @stable
1007
 
     */
1008
 
    enum {
1009
 
        kUnset                 = 0,
1010
 
        kInternallySet,
1011
 
        kMinimumUserStamp
1012
 
    };
1013
 
 
1014
 
    /**
1015
 
     * Pseudo-time-stamps which specify when each field was set. There
1016
 
     * are two special values, UNSET and INTERNALLY_SET. Values from
1017
 
     * MINIMUM_USER_SET to Integer.MAX_VALUE are legal user set values.
1018
 
     * @stable
1019
 
     */
1020
 
    int32_t        fStamp[FIELD_COUNT];
1021
 
 
1022
 
private:
1023
 
 
1024
 
    // The next available value for stampp[]
1025
 
    int32_t fNextStamp;// = MINIMUM_USER_STAMP;
1026
 
 
1027
 
    /**
1028
 
     * The current time set for the calendar.
1029
 
     */
1030
 
    UDate        fTime;
1031
 
 
1032
 
    /**
1033
 
     * @see   #setLenient
1034
 
     */
1035
 
    UBool      fLenient;
1036
 
 
1037
 
    /**
1038
 
     * Time zone affects the time calculation done by Calendar. Calendar subclasses use
1039
 
     * the time zone data to produce the local time.
1040
 
     */
1041
 
    TimeZone*   fZone;
1042
 
 
1043
 
    /**
1044
 
     * Both firstDayOfWeek and minimalDaysInFirstWeek are locale-dependent. They are
1045
 
     * used to figure out the week count for a specific date for a given locale. These
1046
 
     * must be set when a Calendar is constructed. For example, in US locale,
1047
 
     * firstDayOfWeek is SUNDAY; minimalDaysInFirstWeek is 1. They are used to figure
1048
 
     * out the week count for a specific date for a given locale. These must be set when
1049
 
     * a Calendar is constructed.
1050
 
     */
1051
 
    EDaysOfWeek fFirstDayOfWeek;
1052
 
    uint8_t     fMinimalDaysInFirstWeek;
1053
 
 
1054
 
    /**
1055
 
     * Sets firstDayOfWeek and minimalDaysInFirstWeek. Called at Calendar construction
1056
 
     * time.
1057
 
     *
1058
 
     * @param desiredLocale  The given locale.
1059
 
     * @param success        Indicates the status of setting the week count data from
1060
 
     *                       the resource for the given locale. Returns U_ZERO_ERROR if
1061
 
     *                       constructed successfully.
1062
 
     */
1063
 
    void        setWeekCountData(const Locale& desiredLocale, UErrorCode& success);
1064
 
 
1065
 
    /**
1066
 
     * Recompute the time and update the status fields isTimeSet
1067
 
     * and areFieldsSet.  Callers should check isTimeSet and only
1068
 
     * call this method if isTimeSet is false.
1069
 
     */
1070
 
    void updateTime(UErrorCode& status);
1071
 
 
1072
 
    /**
1073
 
     * The resource tag for the resource where the week-count data is stored.
1074
 
     */
1075
 
    static const char kDateTimeElements[];
1076
 
};
1077
 
 
1078
 
// -------------------------------------
1079
 
 
1080
 
inline Calendar*
1081
 
Calendar::createInstance(TimeZone* zone, UErrorCode& errorCode)
1082
 
{
1083
 
    // since the Locale isn't specified, use the default locale
1084
 
    return createInstance(zone, Locale::getDefault(), errorCode);
1085
 
}
1086
 
 
1087
 
// -------------------------------------
1088
 
 
1089
 
inline void 
1090
 
Calendar::roll(EDateFields field, UBool up, UErrorCode& status)
1091
 
{
1092
 
    roll(field, (int32_t)(up ? +1 : -1), status);
1093
 
}
1094
 
 
1095
 
// -------------------------------------
1096
 
 
1097
 
/**
1098
 
 * Fast method for subclasses.  The caller must maintain fUserSetDSTOffset and
1099
 
 * fUserSetZoneOffset, as well as the isSet[] array.
1100
 
 */
1101
 
inline void
1102
 
Calendar::internalSet(EDateFields field, int32_t value)
1103
 
{
1104
 
    fFields[field] = value;
1105
 
}
1106
 
 
1107
 
U_NAMESPACE_END
1108
 
 
1109
 
#endif // _CALENDAR