public final class HistoricDate extends Object implements Comparable<HistoricDate>
Defines a historic date which consists of era, year of era, month and day of month.
Instances of this class are agnostic of any specific new-year-strategy other than the
default (first of January) but can use such a strategy
as parameter to determine the real historic year
for display purposes.
The natural order is based on the timeline order.
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(HistoricDate other) |
boolean |
equals(Object obj) |
int |
getDayOfMonth()
Yields the historic day of month.
|
HistoricEra |
getEra()
Yields the historic era.
|
int |
getMonth()
Yields the historic month.
|
int |
getYearOfEra()
Yields the year of the historic era starting on January the first.
|
int |
getYearOfEra(NewYearStrategy newYearStrategy)
Yields the displayed historic year whose begin is determined by given new-year-strategy.
|
int |
hashCode() |
static HistoricDate |
of(HistoricEra era,
int yearOfEra,
int month,
int dom)
Equivalent to
HistoricDate.of(era, yearOfEra, month, dom,
YearDefinition.DUAL_DATING, NewYearRule.BEGIN_OF_JANUARY.until(Integer.MAX_VALUE)). |
static HistoricDate |
of(HistoricEra era,
int yearOfEra,
int month,
int dom,
YearDefinition yearDefinition,
NewYearStrategy newYearStrategy)
Constructs a new tuple of given historic chronological components.
|
String |
toString() |
public static HistoricDate of(HistoricEra era, int yearOfEra, int month, int dom)
Equivalent to HistoricDate.of(era, yearOfEra, month, dom,
YearDefinition.DUAL_DATING, NewYearRule.BEGIN_OF_JANUARY.until(Integer.MAX_VALUE)).
era - historic erayearOfEra - year of related era (>= 1) starting on January the firstmonth - historic month (1-12)dom - historic day of month (1-31)IllegalArgumentException - if any argument is out of required maximum rangeChronoHistory.isValid(HistoricDate),
GregorianMath.MIN_YEAR,
GregorianMath.MAX_YEARpublic static HistoricDate of(HistoricEra era, int yearOfEra, int month, int dom, YearDefinition yearDefinition, NewYearStrategy newYearStrategy)
Constructs a new tuple of given historic chronological components.
Note: A detailed validation is not done. Such a validation is the responsibility
of any ChronoHistory, however. The converted AD-year must not be beyond the
defined range of the class PlainDate.
era - historic erayearOfEra - year of related era (>= 1) starting on January the firstmonth - historic month (1-12)dom - historic day of month (1-31)yearDefinition - defines a strategy how to interprete year of eranewYearStrategy - strategy how to determine New YearIllegalArgumentException - if any argument is out of required maximum range or inconsistentChronoHistory.isValid(HistoricDate),
GregorianMath.MIN_YEAR,
GregorianMath.MAX_YEARpublic HistoricEra getEra()
Yields the historic era.
public int getYearOfEra()
Yields the year of the historic era starting on January the first.
>= 1)getYearOfEra(NewYearStrategy),
NewYearRule.BEGIN_OF_JANUARYpublic int getYearOfEra(NewYearStrategy newYearStrategy)
Yields the displayed historic year whose begin is determined by given new-year-strategy.
newYearStrategy - strategy how to determine New YeargetYearOfEra(),
NewYearRulepublic int getMonth()
Yields the historic month.
public int getDayOfMonth()
Yields the historic day of month.
public int compareTo(HistoricDate other)
compareTo in interface Comparable<HistoricDate>Copyright © 2014–2017. All rights reserved.