@CalendarType(value="roc") public final class MinguoCalendar extends Calendrical<CalendarUnit,MinguoCalendar> implements LocalizedPatternSupport
The Minguo calendar used in Taiwan (Republic Of China) uses as only difference to western gregorian calendar a different year numbering with the Minguo era 1912-01-01.
See also: Wikipedia.
Following elements which are declared as constants are registered by this class:
Furthermore, all elements defined in EpochDays and CommonElements are supported.
| Modifier and Type | Field and Description |
|---|---|
static StdCalendarElement<java.lang.Integer,MinguoCalendar> |
DAY_OF_MONTH
Represents the day of month.
|
static StdCalendarElement<Weekday,MinguoCalendar> |
DAY_OF_WEEK
Represents the day of week.
|
static StdCalendarElement<java.lang.Integer,MinguoCalendar> |
DAY_OF_YEAR
Represents the day of year.
|
static ChronoElement<MinguoEra> |
ERA
Represents the Minguo era which cannot be changed.
|
static StdCalendarElement<Month,MinguoCalendar> |
MONTH_OF_YEAR
Represents the month.
|
static StdCalendarElement<java.lang.Integer,MinguoCalendar> |
YEAR_OF_ERA
Represents the Minguo year.
|
| Modifier and Type | Method and Description |
|---|---|
GeneralTimestamp<MinguoCalendar> |
at(PlainTime time)
Creates a new local timestamp with this date and given wall time.
|
GeneralTimestamp<MinguoCalendar> |
atTime(int hour,
int minute)
Is equivalent to
at(PlainTime.of(hour, minute)). |
static TimeAxis<CalendarUnit,MinguoCalendar> |
axis()
Returns the associated time axis.
|
boolean |
equals(java.lang.Object obj)
Based on the epoch day number and the calendar system.
|
int |
getDayOfMonth()
Yields the day of month.
|
Weekday |
getDayOfWeek()
Determines the day of week.
|
int |
getDayOfYear()
Yields the day of year.
|
static Weekmodel |
getDefaultWeekmodel()
Obtains the standard week model of this calendar.
|
MinguoEra |
getEra()
Yields the Minguo era.
|
Month |
getMonth()
Yields the (gregorian) month.
|
int |
getYear()
Yields the Minguo year.
|
int |
hashCode()
Based on the epoch day number.
|
boolean |
isLeapYear()
Is the year of this date a leap year?
|
int |
lengthOfMonth()
Yields the length of current month in days.
|
int |
lengthOfYear()
Yields the length of current year in days.
|
static MinguoCalendar |
nowInSystemTime()
Obtains the current calendar date in system time.
|
static MinguoCalendar |
of(MinguoEra era,
int yearOfEra,
int month,
int dayOfMonth)
Creates a new instance of an Minguo calendar date.
|
static MinguoCalendar |
of(MinguoEra era,
int yearOfEra,
Month month,
int dayOfMonth)
Creates a new instance of a Minguo calendar date.
|
java.lang.String |
toString()
Provides a complete textual representation of the state of
this time point.
|
compareTo, getDaysSinceEpochUTC, isAfter, isBefore, isSimultaneous, minus, plus, transform, transform, transformmax, min, minus, minus, plus, plus, until, untilcontains, get, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, isValid, matches, with, with, with, with@FormattableElement(format="G") public static final ChronoElement<MinguoEra> ERA
Represents the Minguo era which cannot be changed.
@FormattableElement(format="y") public static final StdCalendarElement<java.lang.Integer,MinguoCalendar> YEAR_OF_ERA
Represents the Minguo year.
@FormattableElement(format="M", standalone="L") public static final StdCalendarElement<Month,MinguoCalendar> MONTH_OF_YEAR
Represents the month.
@FormattableElement(format="d") public static final StdCalendarElement<java.lang.Integer,MinguoCalendar> DAY_OF_MONTH
Represents the day of month.
@FormattableElement(format="D") public static final StdCalendarElement<java.lang.Integer,MinguoCalendar> DAY_OF_YEAR
Represents the day of year.
@FormattableElement(format="E") public static final StdCalendarElement<Weekday,MinguoCalendar> DAY_OF_WEEK
Represents the day of week.
If the day-of-week is set to a new value then Time4J handles the calendar week as starting on Sunday.
public static MinguoCalendar of(MinguoEra era, int yearOfEra, Month month, int dayOfMonth)
Creates a new instance of a Minguo calendar date.
era - Minguo erayearOfEra - Minguo year of eramonth - gregorian monthdayOfMonth - day of monthMinguoCalendarjava.lang.IllegalArgumentException - in case of any inconsistenciespublic static MinguoCalendar of(MinguoEra era, int yearOfEra, int month, int dayOfMonth)
Creates a new instance of an Minguo calendar date.
era - Minguo erayearOfEra - Minguo year of eramonth - gregorian monthdayOfMonth - day of monthMinguoCalendarjava.lang.IllegalArgumentException - in case of any inconsistenciespublic static MinguoCalendar nowInSystemTime()
Obtains the current calendar date in system time.
Convenient short-cut for: SystemClock.inLocalView().now(MinguoCalendar.axis()).
SystemClock.inLocalView(),
ZonalClock.now(net.time4j.engine.Chronology)public MinguoEra getEra()
Yields the Minguo era.
public int getYear()
Yields the Minguo year.
public Month getMonth()
Yields the (gregorian) month.
public int getDayOfMonth()
Yields the day of month.
public Weekday getDayOfWeek()
Determines the day of week.
public int getDayOfYear()
Yields the day of year.
public int lengthOfMonth()
Yields the length of current month in days.
public int lengthOfYear()
Yields the length of current year in days.
public boolean isLeapYear()
Is the year of this date a leap year?
public GeneralTimestamp<MinguoCalendar> 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<MinguoCalendar> 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)java.lang.IllegalArgumentException - if any argument is out of rangepublic boolean equals(java.lang.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<CalendarUnit,MinguoCalendar>Chronology.getChronoType()public int hashCode()
CalendricalBased on the epoch day number.
hashCode in class Calendrical<CalendarUnit,MinguoCalendar>public java.lang.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).
toString in class TimePoint<CalendarUnit,MinguoCalendar>public static Weekmodel getDefaultWeekmodel()
Obtains the standard week model of this calendar.
The Minguo calendar usually starts on Sunday.
public static TimeAxis<CalendarUnit,MinguoCalendar> axis()
Returns the associated time axis.