public abstract class EastAsianCalendar<U,D extends EastAsianCalendar<U,D>> extends Calendrical<U,D>
Base class of all calendars which are derivates of the lunisolar rural calendar invented in China.
The underlying calendrical algorithms are based on the astronomical formula of Jean Meeus and the book "Calendrical Calculations" by Dershowitz/Reingold. The differences between the concrete subclasses are mainly limited to the supported date range and the geographical meridian defining the timezone offset for evaluating the astronomical data.
| Modifier and Type | Method and Description |
|---|---|
GeneralTimestamp<D> |
at(PlainTime time)
Creates a new local timestamp with this date and given wall time.
|
GeneralTimestamp<D> |
atTime(int hour,
int minute)
Is equivalent to
at(PlainTime.of(hour, minute)). |
boolean |
equals(Object obj)
Based on the epoch day number and the calendar system.
|
Optional<EastAsianMonth> |
findLeapMonth()
Tries to obtain the leap month of the calendar year associated with this calendar date.
|
int |
getDayOfMonth()
Yields the day of month in the range
1-29/30. |
Weekday |
getDayOfWeek()
Determines the day of week.
|
int |
getDayOfYear()
Yields the day of year.
|
long |
getDaysSinceEpochUTC()
Counts the elapsed days since UTC epoch.
|
EastAsianMonth |
getMonth()
Yields the (lunar) month including the numerical value and the possible leap month flag.
|
SexagesimalName |
getSexagesimalDay()
Obtains the sexagesimal name of day component which repeats every 60th day.
|
SexagesimalName |
getSexagesimalMonth()
Obtains the sexagesimal name of solar month component which repeats every 60th solar term.
|
SolarTerm |
getSolarTerm()
Obtains the solar term as one of 24 on the ecliptic of the sun.
|
CyclicYear |
getYear()
Obtains the cyclic year (using a sexagesimal cycle).
|
int |
hashCode()
Based on the epoch day number.
|
boolean |
isLeapYear()
Is the year of this date a leap year such that it contains a leap month?
|
int |
lengthOfMonth()
Yields the length of current month in days.
|
int |
lengthOfYear()
Yields the length of current year in days.
|
String |
toString()
Provides a complete textual representation of the state of
this time point.
|
D |
withBeginOfNextLeapMonth()
Obtains the calendar date of the begin of next leap month.
|
compareTo, isAfter, isBefore, isSimultaneous, minus, plusmax, min, minus, minus, plus, plus, until, untilcontains, get, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, isValid, matches, with, with, with, withfrom, from, from, transform, transform, transform, transform, transform, transformisAfterAll, isAfterOrEqual, isBeforeAll, isBeforeOrEqualpublic CyclicYear getYear()
Obtains the cyclic year (using a sexagesimal cycle).
public SolarTerm getSolarTerm()
Obtains the solar term as one of 24 on the ecliptic of the sun.
public EastAsianMonth getMonth()
Yields the (lunar) month including the numerical value and the possible leap month flag.
public int getDayOfMonth()
Yields the day of month in the range 1-29/30.
public Weekday getDayOfWeek()
Determines the day of week.
public int getDayOfYear()
Yields the day of year.
>= 1public SexagesimalName getSexagesimalMonth()
Obtains the sexagesimal name of solar month component which repeats every 60th solar term.
getSolarTerm()public SexagesimalName getSexagesimalDay()
Obtains the sexagesimal name of day component which repeats every 60th day.
public boolean isLeapYear()
Is the year of this date a leap year such that it contains a leap month?
findLeapMonth(),
withBeginOfNextLeapMonth()public Optional<EastAsianMonth> findLeapMonth()
Tries to obtain the leap month of the calendar year associated with this calendar date.
Note: If the current year is a leap year then it is possible that the found leap month is before the current calendar date.
isLeapYear(),
withBeginOfNextLeapMonth()public D withBeginOfNextLeapMonth()
Obtains the calendar date of the begin of next leap month.
Example:
ChineseCalendar cc = ChineseCalendar.ofNewYear(2018);
cc = cc.withBeginOfNextLeapMonth();
System.out.println(cc); // chinese[geng-zi(2020)-*4-01]
IllegalArgumentException - if the next leap month is out of range of supported calendar datesisLeapYear(),
findLeapMonth()public int lengthOfMonth()
Yields the length of current month in days.
public int lengthOfYear()
Yields the length of current year in days.
public GeneralTimestamp<D> at(PlainTime time)
Creates a new local timestamp with this date and given wall time.
If the time T24:00 is used
then the resulting timestamp will automatically be normalized such
that the timestamp will contain the following day instead.
time - wall timepublic GeneralTimestamp<D> atTime(int hour, int minute)
Is equivalent to at(PlainTime.of(hour, minute)).
hour - hour of day in range (0-24)minute - minute of hour in range (0-59)IllegalArgumentException - if any argument is out of rangeat(PlainTime)public long getDaysSinceEpochUTC()
CalendarDateCounts the elapsed days since UTC epoch.
getDaysSinceEpochUTC in interface CalendarDategetDaysSinceEpochUTC in class Calendrical<U,D extends EastAsianCalendar<U,D>>EpochDays.UTCpublic boolean equals(Object obj)
CalendricalBased on the epoch day number and the calendar system.
In other words: Two date object are equal if they have the same temporal position on the local timeline and have the same calendrical type. Subclasses which define further state attributes must override this method.
If an only temporal comparison is required then the method
Calendrical.isSimultaneous(CalendarDate) is to be used.
equals in class Calendrical<U,D extends EastAsianCalendar<U,D>>Chronology.getChronoType()public int hashCode()
CalendricalBased on the epoch day number.
hashCode in class Calendrical<U,D extends EastAsianCalendar<U,D>>public String toString()
TimePointProvides a complete textual representation of the state of this time point.
The textual description often follows the conventions of ISO-8601. Usually the description starts with the chronological informations which are coarse-grained and ends with those ones which are fine-grained (for example the ISO-notation YYYY-MM-DD).
Copyright © 2014–2021. All rights reserved.