public final class JapaneseChrono extends Chrono<JapaneseChrono> implements Serializable
This chronology defines the rules of the Japanese Imperial calendar system. This calendar system is primarily used in Japan. The Japanese Imperial calendar system is the same as the ISO calendar system apart from the era-based year numbering.
Only Meiji (1865-04-07 - 1868-09-07) and later eras are supported. Older eras are handled as an unknown era where the year-of-era is the ISO year.
| Modifier and Type | Field and Description |
|---|---|
static Era<JapaneseChrono> |
ERA_HEISEI
The singleton instance for the Heisei era (1989-01-08 - current)
which has the value 2.
|
static Era<JapaneseChrono> |
ERA_MEIJI
The singleton instance for the Meiji era (1868-09-08 - 1912-07-29)
which has the value -1.
|
static Era<JapaneseChrono> |
ERA_SEIREKI
The singleton instance for the before Meiji era ( - 1868-09-07)
which has the value -999.
|
static Era<JapaneseChrono> |
ERA_SHOWA
The singleton instance for the Showa era (1926-12-25 - 1989-01-07)
which has the value 1.
|
static Era<JapaneseChrono> |
ERA_TAISHO
The singleton instance for the Taisho era (1912-07-30 - 1926-12-24)
which has the value 0.
|
static JapaneseChrono |
INSTANCE
Singleton instance for Japanese chronology.
|
| Modifier and Type | Method and Description |
|---|---|
ChronoLocalDate<JapaneseChrono> |
date(Era<JapaneseChrono> era,
int yearOfEra,
int month,
int dayOfMonth)
Obtains a local date in this chronology from the era, year-of-era,
month-of-year and day-of-month fields.
|
ChronoLocalDate<JapaneseChrono> |
date(int prolepticYear,
int month,
int dayOfMonth)
Obtains a local date in this chronology from the proleptic-year,
month-of-year and day-of-month fields.
|
ChronoLocalDate<JapaneseChrono> |
date(TemporalAccessor temporal)
Obtains a local date in this chronology from another temporal object.
|
ChronoLocalDate<JapaneseChrono> |
dateYearDay(int prolepticYear,
int dayOfYear)
Obtains a local date in this chronology from the proleptic-year and
day-of-year fields.
|
Era<JapaneseChrono> |
eraOf(int eraValue)
Returns the calendar system era object from the given numeric value.
|
List<Era<JapaneseChrono>> |
eras()
Gets the list of eras for the chronology.
|
String |
getCalendarType()
Gets the calendar type of the underlying calendar system - 'japanese'.
|
String |
getId()
Gets the ID of the chronology - 'Japanese'.
|
boolean |
isLeapYear(long prolepticYear)
Checks if the specified year is a leap year.
|
int |
prolepticYear(Era<JapaneseChrono> era,
int yearOfEra)
Calculates the proleptic-year given the era and year-of-era.
|
ValueRange |
range(ChronoField field)
Gets the range of valid values for the specified field.
|
compareTo, dateNow, dateNow, dateNow, dateTime, dateYearDay, ensureChronoLocalDate, ensureChronoLocalDateTime, ensureChronoZonedDateTime, equals, from, getAvailableChronologies, getText, hashCode, localDateTime, of, ofLocale, toString, zonedDateTime, zonedDateTimepublic static final JapaneseChrono INSTANCE
public static final Era<JapaneseChrono> ERA_SEIREKI
public static final Era<JapaneseChrono> ERA_MEIJI
public static final Era<JapaneseChrono> ERA_TAISHO
public static final Era<JapaneseChrono> ERA_SHOWA
public static final Era<JapaneseChrono> ERA_HEISEI
public String getId()
The ID uniquely identifies the Chrono.
It can be used to lookup the Chrono using Chrono.of(String).
getId in class Chrono<JapaneseChrono>getCalendarType()public String getCalendarType()
The calendar type is an identifier defined by the
Unicode Locale Data Markup Language (LDML) specification.
It can be used to lookup the Chrono using Chrono.of(String).
It can also be used as part of a locale, accessible via
Locale.getUnicodeLocaleType(String) with the key 'ca'.
getCalendarType in class Chrono<JapaneseChrono>getId()public ChronoLocalDate<JapaneseChrono> date(Era<JapaneseChrono> era, int yearOfEra, int month, int dayOfMonth)
Chronodate in class Chrono<JapaneseChrono>era - the era of the correct type for the chronology, not nullyearOfEra - the chronology year-of-eramonth - the chronology month-of-yeardayOfMonth - the chronology day-of-monthpublic ChronoLocalDate<JapaneseChrono> date(int prolepticYear, int month, int dayOfMonth)
Chronodate in class Chrono<JapaneseChrono>prolepticYear - the chronology proleptic-yearmonth - the chronology month-of-yeardayOfMonth - the chronology day-of-monthpublic ChronoLocalDate<JapaneseChrono> dateYearDay(int prolepticYear, int dayOfYear)
ChronodateYearDay in class Chrono<JapaneseChrono>prolepticYear - the chronology proleptic-yeardayOfYear - the chronology day-of-yearpublic ChronoLocalDate<JapaneseChrono> date(TemporalAccessor temporal)
Chrono
This creates a date in this chronology based on the specified TemporalAccessor.
The standard mechanism for conversion between date types is the
local epoch-day field.
date in class Chrono<JapaneseChrono>temporal - the temporal object to convert, not nullpublic boolean isLeapYear(long prolepticYear)
Japanese calendar leap years occur exactly in line with ISO leap years. This method does not validate the year passed in, and only has a well-defined result for years in the supported range.
isLeapYear in class Chrono<JapaneseChrono>prolepticYear - the proleptic-year to check, not validated for rangepublic int prolepticYear(Era<JapaneseChrono> era, int yearOfEra)
ChronoThis combines the era and year-of-era into the single proleptic-year field.
prolepticYear in class Chrono<JapaneseChrono>era - the era of the correct type for the chronology, not nullyearOfEra - the chronology year-of-erapublic Era<JapaneseChrono> eraOf(int eraValue)
ERA_HEISEI, ERA_SHOWA,ERA_TAISHO,
ERA_MEIJI), only Meiji and later eras are supported.
Prior to Meiji ERA_SEIREKI is used.eraOf in class Chrono<JapaneseChrono>eraValue - the era valueEra for the given numeric era valueDateTimeException - if eraValue is invalidpublic List<Era<JapaneseChrono>> eras()
ChronoMost calendar systems have an era, within which the year has meaning. If the calendar system does not support the concept of eras, an empty list must be returned.
eras in class Chrono<JapaneseChrono>public ValueRange range(ChronoField field)
Chrono
All fields can be expressed as a long integer.
This method returns an object that describes the valid range for that value.
Note that the result only describes the minimum and maximum valid values and it is important not to read too much into them. For example, there could be values within the range that are invalid for the field.
This method will return a result whether or not the chronology supports the field.
range in class Chrono<JapaneseChrono>field - the field to get the range for, not nullCopyright © 2007-2013 ThreeTen.org. All Rights Reserved.