public final class HistoricDate extends java.lang.Object implements java.lang.Comparable<HistoricDate>
Defines a historical date which consists of era, year of era, month and day of month.
The natural order is based on the timeline order.
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(HistoricDate other) |
boolean |
equals(java.lang.Object obj) |
int |
getDayOfMonth()
Yields the historical day of month.
|
HistoricEra |
getEra()
Yields the historical era.
|
int |
getMonth()
Yields the historical month.
|
int |
getYearOfEra()
Yields year of the historical era.
|
int |
hashCode() |
static HistoricDate |
of(HistoricEra era,
int yearOfEra,
int month,
int dom)
Constructs a new tuple of given historical chronological components.
|
java.lang.String |
toString() |
public static HistoricDate of(HistoricEra era, int yearOfEra, int month, int dom)
Constructs a new tuple of given historical chronological components.
Note: A detailed validation is not done. Such a validation is the responsibility
of any ChronoHistory, however.
era - historical era (AD or BC)yearOfEra - year of related era (>= 1)month - historical month (1-12)dom - historical day of month (1-31)java.lang.IllegalArgumentException - if any argument is out of required maximum rangeChronoHistory.isValid(HistoricDate)public HistoricEra getEra()
Yields the historical era.
public int getYearOfEra()
Yields year of the historical era.
>= 1)public int getMonth()
Yields the historical month.
public int getDayOfMonth()
Yields the historical day of month.
public int compareTo(HistoricDate other)
compareTo in interface java.lang.Comparable<HistoricDate>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object