CalendarDate class represents a specific instant
in time by calendar date and time fields that are multiple cycles
in different time unites. The semantics of each calendar field is
given by a concrete calendar system rather than this
CalendarDate class that holds calendar field values
without interpreting them. Therefore, this class can be used to
represent an amount of time, such as 2 years and 3 months.
A CalendarDate instance can be created by calling
the newCalendarDate or getCalendarDate
methods in CalendarSystem. A
CalendarSystem instance is obtained by calling one of
the factory methods in CalendarSystem. Manipulations
of calendar dates must be handled by the calendar system by which
CalendarDate instances have been created.
Some calendar fields can be modified through method calls. Any
modification of a calendar field brings the state of a
CalendarDate to not normalized. The
normalization must be performed to make all the calendar fields
consistent with a calendar system.
The protected methods are intended to be used for
implementing a concrete calendar system, not for general use as an
API.
CalendarSystem
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private int | |
| private Era | |
| public static final int | |
| private long | |
| private int | |
| private boolean | |
| private int | |
| private int | |
| private int | |
| private boolean | |
| private int | |
| public static final long | |
| private int | |
| private TimeZone | |
| private int |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public CalendarDate | |
| public CalendarDate | |
| public CalendarDate | |
| public Object | Returns: a copy of thisCalendarDateOverrides java. Returns a copy of this |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public int | |
| public int | |
| public Era | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public long | |
| public int | |
| public TimeZone | |
| public int | |
| public int | |
| public boolean | |
| public boolean | Returns: true if this CalendarDate is
normalized and the year of this CalendarDate is a
leap year, or false otherwise.Returns whether the year represented by this
|
| public boolean | |
| public boolean | isSameDate(CalendarDate date)
Returns whether the specified date is the same date of this
|
| public CalendarDate | |
| protected void | |
| public CalendarDate | |
| protected void | |
| public CalendarDate | |
| public CalendarDate | |
| pack-priv void | |
| public CalendarDate | |
| public CalendarDate | |
| public CalendarDate | |
| protected void | |
| public CalendarDate | |
| public CalendarDate | |
| protected void | |
| public CalendarDate | |
| public CalendarDate | |
| protected void | |
| public String | toString()
Overrides java. Converts calendar date values to a |
| daylightSaving | back to summary |
|---|---|
| private int daylightSaving | |
| dayOfMonth | back to summary |
|---|---|
| private int dayOfMonth | |
| dayOfWeek | back to summary |
|---|---|
| private int dayOfWeek | |
| era | back to summary |
|---|---|
| private Era era | |
| FIELD_UNDEFINED | back to summary |
|---|---|
| public static final int FIELD_UNDEFINED | |
| fraction | back to summary |
|---|---|
| private long fraction | |
| hours | back to summary |
|---|---|
| private int hours | |
| leapYear | back to summary |
|---|---|
| private boolean leapYear | |
| millis | back to summary |
|---|---|
| private int millis | |
| minutes | back to summary |
|---|---|
| private int minutes | |
| month | back to summary |
|---|---|
| private int month | |
| normalized | back to summary |
|---|---|
| private boolean normalized | |
| seconds | back to summary |
|---|---|
| private int seconds | |
| TIME_UNDEFINED | back to summary |
|---|---|
| public static final long TIME_UNDEFINED | |
| year | back to summary |
|---|---|
| private int year | |
| zoneinfo | back to summary |
|---|---|
| private TimeZone zoneinfo | |
| zoneOffset | back to summary |
|---|---|
| private int zoneOffset | |
| CalendarDate | back to summary |
|---|---|
| protected CalendarDate() | |
| CalendarDate | back to summary |
|---|---|
| protected CalendarDate(TimeZone zone) | |
| addHours | back to summary |
|---|---|
| public CalendarDate addHours(int n) | |
| addMonth | back to summary |
|---|---|
| public CalendarDate addMonth(int n) | |
| addYear | back to summary |
|---|---|
| public CalendarDate addYear(int n) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Returns a copy of this | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getDaylightSaving | back to summary |
|---|---|
| public int getDaylightSaving() | |
| getDayOfMonth | back to summary |
|---|---|
| public int getDayOfMonth() | |
| getDayOfWeek | back to summary |
|---|---|
| public int getDayOfWeek() Returns the day of week value. If this CalendarDate is not
normalized,
| |
| getEra | back to summary |
|---|---|
| public Era getEra() | |
| getHours | back to summary |
|---|---|
| public int getHours() | |
| getMillis | back to summary |
|---|---|
| public int getMillis() | |
| getMinutes | back to summary |
|---|---|
| public int getMinutes() | |
| getMonth | back to summary |
|---|---|
| public int getMonth() | |
| getSeconds | back to summary |
|---|---|
| public int getSeconds() | |
| getTimeOfDay | back to summary |
|---|---|
| public long getTimeOfDay() | |
| getYear | back to summary |
|---|---|
| public int getYear() | |
| getZone | back to summary |
|---|---|
| public TimeZone getZone() | |
| getZoneOffset | back to summary |
|---|---|
| public int getZoneOffset() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isDaylightTime | back to summary |
|---|---|
| public boolean isDaylightTime() | |
| isLeapYear | back to summary |
|---|---|
| public boolean isLeapYear() Returns whether the year represented by this
If this
| |
| isNormalized | back to summary |
|---|---|
| public boolean isNormalized() | |
| isSameDate | back to summary |
|---|---|
| public boolean isSameDate(CalendarDate date) Returns whether the specified date is the same date of this
| |
| setDate | back to summary |
|---|---|
| public CalendarDate setDate(int year, int month, int dayOfMonth) | |
| setDaylightSaving | back to summary |
|---|---|
| protected void setDaylightSaving(int daylightSaving) | |
| setDayOfMonth | back to summary |
|---|---|
| public CalendarDate setDayOfMonth(int date) | |
| setDayOfWeek | back to summary |
|---|---|
| protected void setDayOfWeek(int dayOfWeek) | |
| setEra | back to summary |
|---|---|
| public CalendarDate setEra(Era era) Sets the era of the date to the specified era. The default
implementation of this method accepts any Era value, including
| |
| setHours | back to summary |
|---|---|
| public CalendarDate setHours(int hours) | |
| setLeapYear | back to summary |
|---|---|
| pack-priv void setLeapYear(boolean leapYear) | |
| setMillis | back to summary |
|---|---|
| public CalendarDate setMillis(int millis) | |
| setMinutes | back to summary |
|---|---|
| public CalendarDate setMinutes(int minutes) | |
| setMonth | back to summary |
|---|---|
| public CalendarDate setMonth(int month) | |
| setNormalized | back to summary |
|---|---|
| protected void setNormalized(boolean normalized) | |
| setSeconds | back to summary |
|---|---|
| public CalendarDate setSeconds(int seconds) | |
| setTimeOfDay | back to summary |
|---|---|
| public CalendarDate setTimeOfDay(int hours, int minutes, int seconds, int millis) | |
| setTimeOfDay | back to summary |
|---|---|
| protected void setTimeOfDay(long fraction) | |
| setYear | back to summary |
|---|---|
| public CalendarDate setYear(int year) | |
| setZone | back to summary |
|---|---|
| public CalendarDate setZone(TimeZone zoneinfo) | |
| setZoneOffset | back to summary |
|---|---|
| protected void setZoneOffset(int offset) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Converts calendar date values to a
yyyy-MM-dd'T'HH:mm:ss.SSSz
| |