CalendarSystem is an abstract class that defines the
programming interface to deal with calendar date and time.
CalendarSystem instances are singletons. For
example, there exists only one Gregorian calendar instance in the
Java runtime environment. A singleton instance can be obtained
calling one of the static factory methods.
For the methods in a CalendarSystem that manipulate
a CalendarDate, CalendarDates that have
been created by the CalendarSystem must be
specified. Otherwise, the methods throw an exception. This is
because, for example, a Chinese calendar date can't be understood
by the Hebrew calendar system.
Name Calendar System --------------------------------------- gregorian Gregorian Calendar julian Julian Calendar japanese Japanese Imperial Calendar
CalendarDate
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static ConcurrentMap | |
| private static volatile boolean | |
| private static final String[] | |
| private static ConcurrentMap | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static CalendarSystem | |
| public abstract CalendarDate | |
| public abstract CalendarDate | Returns: aCalendarDate instance that contains the
calculated calendar field values.the offset value in milliseconds from January 1,
1970 00:00:00 UTC (Gregorian). millis)Calculates calendar fields from the specified number of milliseconds since the Epoch, January 1, 1970 00:00:00 UTC (Gregorian). |
| public abstract CalendarDate | |
| public abstract CalendarDate | |
| public abstract Era | |
| public abstract Era[] | Returns: an array of validEras, or
null if no era is applicable to this calendar
system.Returns valid |
| public static Gregorian | Returns: theGregorian instanceReturns the singleton instance of the |
| public abstract int | Returns: the number of days in the monththe date from which the month value is obtained date)Returns the length in days of the month specified by the calendar date. |
| public abstract String | |
| public abstract CalendarDate | Returns: the date of the nthdayOfWeek after
or before the specified CalendarDatespecifies the n-th one. A positive number specifies
on or after the nth, int date. A non-positive number
specifies on or before the date.the day of week dayOfWeek, CalendarDate the date date)Returns a |
| public abstract long | Returns: the number of milliseconds since the Epoch.the date)CalendarDate from which the time
value is calculatedReturns the number of milliseconds since the Epoch, January 1,
1970 00:00:00 UTC (Gregorian), represented by the specified
|
| public abstract int | |
| private static void | |
| public abstract CalendarDate | Returns: aCalendarDate instance that contains the initial
calendar field values.Constructs a |
| public abstract CalendarDate | |
| public abstract boolean | Returns: true if all fields have been normalized;
false otherwise.the calendar date to be validated date)Normalizes calendar fields in the specified
|
| public abstract CalendarDate | |
| public abstract boolean | Returns: true if all the calendar fields are consistent,
otherwise, false is returned.the date)CalendarDate to be validatedChecks whether the calendar fields specified by |
| calendars | back to summary |
|---|---|
| private static ConcurrentMap<String, CalendarSystem> calendars | |
| initialized | back to summary |
|---|---|
| private static volatile boolean initialized | |
| namePairs | back to summary |
|---|---|
| private static final String[] namePairs | |
| names | back to summary |
|---|---|
| private static ConcurrentMap<String, String> names | |
| PACKAGE_NAME | back to summary |
|---|---|
| private static final String PACKAGE_NAME | |
| CalendarSystem | back to summary |
|---|---|
| public CalendarSystem() | |
| forName | back to summary |
|---|---|
| public static CalendarSystem forName(String calendarName) Returns a
| |
| getCalendarDate | back to summary |
|---|---|
| public abstract CalendarDate getCalendarDate() | |
| getCalendarDate | back to summary |
|---|---|
| public abstract CalendarDate getCalendarDate(long millis) Calculates calendar fields from the specified number of milliseconds since the Epoch, January 1, 1970 00:00:00 UTC (Gregorian). This method doesn't check overflow or underflow when adjusting the millisecond value (representing UTC) with the time zone offsets (i.e., the GMT offset and amount of daylight saving).
| |
| getCalendarDate | back to summary |
|---|---|
| public abstract CalendarDate getCalendarDate(long millis, CalendarDate date) | |
| getCalendarDate | back to summary |
|---|---|
| public abstract CalendarDate getCalendarDate(long millis, TimeZone zone) | |
| getEra | back to summary |
|---|---|
| public abstract Era getEra(String eraName) Returns the | |
| getEras | back to summary |
|---|---|
| public abstract Era[] getEras() Returns valid
| |
| getGregorianCalendar | back to summary |
|---|---|
| public static Gregorian getGregorianCalendar() Returns the singleton instance of the
| |
| getMonthLength | back to summary |
|---|---|
| public abstract int getMonthLength(CalendarDate date) Returns the length in days of the month specified by the calendar
date. This method does not perform the normalization with the
specified calendar date. The
| |
| getName | back to summary |
|---|---|
| public abstract String getName() Returns the name of this calendar system. | |
| getNthDayOfWeek | back to summary |
|---|---|
| public abstract CalendarDate getNthDayOfWeek(int nth, int dayOfWeek, CalendarDate date) Returns a
This method returns a new CalendarDate instance
and doesn't modify the original date.
| |
| getTime | back to summary |
|---|---|
| public abstract long getTime(CalendarDate date) Returns the number of milliseconds since the Epoch, January 1,
1970 00:00:00 UTC (Gregorian), represented by the specified
| |
| getYearLength | back to summary |
|---|---|
| public abstract int getYearLength(CalendarDate date) Returns the length in days of the specified year by
| |
| initNames | back to summary |
|---|---|
| private static void initNames() | |
| newCalendarDate | back to summary |
|---|---|
| public abstract CalendarDate newCalendarDate() Constructs a
| |
| newCalendarDate | back to summary |
|---|---|
| public abstract CalendarDate newCalendarDate(TimeZone zone) | |
| normalize | back to summary |
|---|---|
| public abstract boolean normalize(CalendarDate date) Normalizes calendar fields in the specified
| |
| setTimeOfDay | back to summary |
|---|---|
| public abstract CalendarDate setTimeOfDay(CalendarDate date, int timeOfDay) | |
| validate | back to summary |
|---|---|
| public abstract boolean validate(CalendarDate date) Checks whether the calendar fields specified by
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final Gregorian |
| Access | Constructor and Description |
|---|---|
| private |
| GREGORIAN_INSTANCE | back to summary |
|---|---|
| private static final Gregorian GREGORIAN_INSTANCE | |
| GregorianHolder | back to summary |
|---|---|
| private GregorianHolder() | |