java.io.Serializablepublic final class CopticChronology
extends java.time.chrono.AbstractChronology
implements java.io.Serializable
This chronology defines the rules of the Coptic calendar system.
This calendar system is primarily used in Christian Egypt.
Dates are aligned such that 0001-01-01 (Coptic) is 0284-08-29 (ISO).
The fields are defined as follows:
| Modifier and Type | Field | Description |
|---|---|---|
static CopticChronology |
INSTANCE |
Singleton instance for the Coptic chronology.
|
| Constructor | Description |
|---|---|
CopticChronology() |
Deprecated.
Use the singleton
INSTANCE instead. |
| Modifier and Type | Method | Description |
|---|---|---|
CopticDate |
date(int prolepticYear,
int month,
int dayOfMonth) |
Obtains a local date in Coptic calendar system from the
proleptic-year, month-of-year and day-of-month fields.
|
CopticDate |
date(java.time.chrono.Era era,
int yearOfEra,
int month,
int dayOfMonth) |
Obtains a local date in Coptic calendar system from the
era, year-of-era, month-of-year and day-of-month fields.
|
CopticDate |
date(java.time.temporal.TemporalAccessor temporal) |
Obtains a Coptic local date from another date-time object.
|
CopticDate |
dateEpochDay(long epochDay) |
Obtains a local date in the Coptic calendar system from the epoch-day.
|
CopticDate |
dateNow() |
Obtains the current Coptic local date from the system clock in the default time-zone.
|
CopticDate |
dateNow(java.time.Clock clock) |
Obtains the current Coptic local date from the specified clock.
|
CopticDate |
dateNow(java.time.ZoneId zone) |
Obtains the current Coptic local date from the system clock in the specified time-zone.
|
CopticDate |
dateYearDay(int prolepticYear,
int dayOfYear) |
Obtains a local date in Coptic calendar system from the
proleptic-year and day-of-year fields.
|
CopticDate |
dateYearDay(java.time.chrono.Era era,
int yearOfEra,
int dayOfYear) |
Obtains a local date in Coptic calendar system from the
era, year-of-era and day-of-year fields.
|
CopticEra |
eraOf(int eraValue) |
|
java.util.List<java.time.chrono.Era> |
eras() |
|
java.lang.String |
getCalendarType() |
Gets the calendar type of the underlying calendar system - 'coptic'.
|
java.lang.String |
getId() |
Gets the ID of the chronology - 'Coptic'.
|
boolean |
isLeapYear(long prolepticYear) |
Checks if the specified year is a leap year.
|
java.time.chrono.ChronoLocalDateTime<CopticDate> |
localDateTime(java.time.temporal.TemporalAccessor temporal) |
Obtains a Coptic local date-time from another date-time object.
|
int |
prolepticYear(java.time.chrono.Era era,
int yearOfEra) |
|
java.time.temporal.ValueRange |
range(java.time.temporal.ChronoField field) |
|
CopticDate |
resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long> fieldValues,
java.time.format.ResolverStyle resolverStyle) |
|
java.time.chrono.ChronoZonedDateTime<CopticDate> |
zonedDateTime(java.time.Instant instant,
java.time.ZoneId zone) |
Obtains a Coptic zoned date-time in this chronology from an
Instant. |
java.time.chrono.ChronoZonedDateTime<CopticDate> |
zonedDateTime(java.time.temporal.TemporalAccessor temporal) |
Obtains a Coptic zoned date-time from another date-time object.
|
compareTo, equals, hashCode, toStringpublic static final CopticChronology INSTANCE
@Deprecated public CopticChronology()
INSTANCE instead.ServiceLoader.public java.lang.String getId()
The ID uniquely identifies the Chronology.
It can be used to lookup the Chronology using Chronology.of(String).
getCalendarType()public java.lang.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 Chronology using Chronology.of(String).
It can also be used as part of a locale, accessible via
Locale.getUnicodeLocaleType(String) with the key 'ca'.
getId()public CopticDate date(java.time.chrono.Era era, int yearOfEra, int month, int dayOfMonth)
era - the Coptic era, not nullyearOfEra - the year-of-eramonth - the month-of-yeardayOfMonth - the day-of-monthjava.time.DateTimeException - if unable to create the datejava.lang.ClassCastException - if the era is not a CopticErapublic CopticDate date(int prolepticYear, int month, int dayOfMonth)
prolepticYear - the proleptic-yearmonth - the month-of-yeardayOfMonth - the day-of-monthjava.time.DateTimeException - if unable to create the datepublic CopticDate dateYearDay(java.time.chrono.Era era, int yearOfEra, int dayOfYear)
era - the Coptic era, not nullyearOfEra - the year-of-eradayOfYear - the day-of-yearjava.time.DateTimeException - if unable to create the datejava.lang.ClassCastException - if the era is not a CopticErapublic CopticDate dateYearDay(int prolepticYear, int dayOfYear)
prolepticYear - the proleptic-yeardayOfYear - the day-of-yearjava.time.DateTimeException - if unable to create the datepublic CopticDate dateEpochDay(long epochDay)
epochDay - the epoch dayjava.time.DateTimeException - if unable to create the datepublic CopticDate dateNow()
This will query the system clock in the default
time-zone to obtain the current date.
Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
java.time.DateTimeException - if unable to create the datepublic CopticDate dateNow(java.time.ZoneId zone)
This will query the system clock to obtain the current date.
Specifying the time-zone avoids dependence on the default time-zone.
Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
zone - the zone ID to use, not nulljava.time.DateTimeException - if unable to create the datepublic CopticDate dateNow(java.time.Clock clock)
This will query the specified clock to obtain the current date - today.
Using this method allows the use of an alternate clock for testing.
The alternate clock may be introduced using dependency injection.
clock - the clock to use, not nulljava.time.DateTimeException - if unable to create the datepublic CopticDate date(java.time.temporal.TemporalAccessor temporal)
temporal - the date-time object to convert, not nulljava.time.DateTimeException - if unable to create the datepublic java.time.chrono.ChronoLocalDateTime<CopticDate> localDateTime(java.time.temporal.TemporalAccessor temporal)
temporal - the date-time object to convert, not nulljava.time.DateTimeException - if unable to create the date-timepublic java.time.chrono.ChronoZonedDateTime<CopticDate> zonedDateTime(java.time.temporal.TemporalAccessor temporal)
temporal - the date-time object to convert, not nulljava.time.DateTimeException - if unable to create the date-timepublic java.time.chrono.ChronoZonedDateTime<CopticDate> zonedDateTime(java.time.Instant instant, java.time.ZoneId zone)
Instant.instant - the instant to create the date-time from, not nullzone - the time-zone, not nulljava.time.DateTimeException - if the result exceeds the supported rangepublic int prolepticYear(java.time.chrono.Era era,
int yearOfEra)
public CopticEra eraOf(int eraValue)
public java.util.List<java.time.chrono.Era> eras()
public CopticDate resolveDate(java.util.Map<java.time.temporal.TemporalField,java.lang.Long> fieldValues, java.time.format.ResolverStyle resolverStyle)
resolveDate in class java.time.chrono.AbstractChronologypublic boolean isLeapYear(long prolepticYear)
The proleptic-year is leap if the remainder after division by four equals three. This method does not validate the year passed in, and only has a well-defined result for years in the supported range.
prolepticYear - the proleptic-year to check, not validated for rangepublic java.time.temporal.ValueRange range(java.time.temporal.ChronoField field)
Copyright © 2010–2018 ThreeTen.org. All rights reserved.