Serializable, Comparable<Chronology>, Chronologypublic final class DiscordianChronology extends AbstractChronology implements Serializable
This chronology defines the rules of the proleptic Discordian calendar system. The Discordian differs from the Gregorian in terms of month and week lengths, with an offset year. Dates are aligned such that each Discordian year starts with each ISO year, with an offset index.
This class is not proleptic. It implements Discordian rules only since YOLD 1 (ISO BCE 1166).
The fields are defined as follows:
| Modifier and Type | Field | Description |
|---|---|---|
static DiscordianChronology |
INSTANCE |
Singleton instance for the Discordian chronology.
|
| Constructor | Description |
|---|---|
DiscordianChronology() |
Deprecated.
Use the singleton
INSTANCE instead. |
| Modifier and Type | Method | Description |
|---|---|---|
DiscordianDate |
date(int prolepticYear,
int month,
int dayOfMonth) |
Obtains a local date in Discordian calendar system from the
proleptic-year, month-of-year and day-of-month fields.
|
DiscordianDate |
date(Era era,
int yearOfEra,
int month,
int dayOfMonth) |
Obtains a local date in Discordian calendar system from the
era, year-of-era, month-of-year and day-of-month fields.
|
DiscordianDate |
date(TemporalAccessor temporal) |
Obtains a Discordian local date from another date-time object.
|
DiscordianDate |
dateEpochDay(long epochDay) |
Obtains a local date in the Discordian calendar system from the epoch-day.
|
DiscordianDate |
dateNow() |
Obtains the current Discordian local date from the system clock in the default time-zone.
|
DiscordianDate |
dateNow(Clock clock) |
Obtains the current Discordian local date from the specified clock.
|
DiscordianDate |
dateNow(ZoneId zone) |
Obtains the current Discordian local date from the system clock in the specified time-zone.
|
DiscordianDate |
dateYearDay(int prolepticYear,
int dayOfYear) |
Obtains a local date in the Discordian calendar system from the
proleptic-year and day-of-year fields.
|
DiscordianDate |
dateYearDay(Era era,
int yearOfEra,
int dayOfYear) |
Obtains a local date in Discordian calendar system from the
era, year-of-era and day-of-year fields.
|
DiscordianEra |
eraOf(int era) |
|
List<Era> |
eras() |
|
String |
getCalendarType() |
Gets the calendar type of the underlying calendar system - 'discordian'.
|
String |
getId() |
Gets the ID of the chronology - 'Discordian'.
|
boolean |
isLeapYear(long prolepticYear) |
Checks if the specified year is a leap year.
|
ChronoLocalDateTime<DiscordianDate> |
localDateTime(TemporalAccessor temporal) |
Obtains a Discordian local date-time from another date-time object.
|
int |
prolepticYear(Era era,
int yearOfEra) |
|
ValueRange |
range(ChronoField field) |
|
DiscordianDate |
resolveDate(Map<TemporalField,Long> fieldValues,
ResolverStyle resolverStyle) |
|
ChronoZonedDateTime<DiscordianDate> |
zonedDateTime(Instant instant,
ZoneId zone) |
Obtains a Discordian zoned date-time in this chronology from an
Instant. |
ChronoZonedDateTime<DiscordianDate> |
zonedDateTime(TemporalAccessor temporal) |
Obtains a Discordian zoned date-time from another date-time object.
|
compareTo, equals, hashCode, toStringepochSecond, epochSecond, from, getDisplayName, periodpublic static final DiscordianChronology INSTANCE
@Deprecated public DiscordianChronology()
INSTANCE instead.ServiceLoader.public String getId()
The ID uniquely identifies the Chronology.
It can be used to lookup the Chronology using Chronology.of(String).
getId in interface ChronologygetCalendarType()public String getCalendarType()
The Unicode Locale Data Markup Language (LDML) specification does not define an identifier for the Discordian calendar, but were it to do so, 'discordian' is highly likely to be chosen.
getCalendarType in interface ChronologygetId()public DiscordianDate date(Era era, int yearOfEra, int month, int dayOfMonth)
date in interface Chronologyera - the Discordian era, not nullyearOfEra - the year-of-eramonth - the month-of-yeardayOfMonth - the day-of-monthDateTimeException - if unable to create the dateClassCastException - if the era is not a DiscordianErapublic DiscordianDate date(int prolepticYear, int month, int dayOfMonth)
date in interface ChronologyprolepticYear - the proleptic-yearmonth - the month-of-yeardayOfMonth - the day-of-monthDateTimeException - if unable to create the datepublic DiscordianDate dateYearDay(Era era, int yearOfEra, int dayOfYear)
dateYearDay in interface Chronologyera - the Discordian era, not nullyearOfEra - the year-of-eradayOfYear - the day-of-yearDateTimeException - if unable to create the dateClassCastException - if the era is not a DiscordianErapublic DiscordianDate dateYearDay(int prolepticYear, int dayOfYear)
dateYearDay in interface ChronologyprolepticYear - the proleptic-yeardayOfYear - the day-of-yearDateTimeException - if unable to create the datepublic DiscordianDate dateEpochDay(long epochDay)
dateEpochDay in interface ChronologyepochDay - the epoch dayDateTimeException - if unable to create the datepublic DiscordianDate 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.
dateNow in interface ChronologyDateTimeException - if unable to create the datepublic DiscordianDate dateNow(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.
dateNow in interface Chronologyzone - the zone ID to use, not nullDateTimeException - if unable to create the datepublic DiscordianDate dateNow(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.
dateNow in interface Chronologyclock - the clock to use, not nullDateTimeException - if unable to create the datepublic DiscordianDate date(TemporalAccessor temporal)
date in interface Chronologytemporal - the date-time object to convert, not nullDateTimeException - if unable to create the datepublic ChronoLocalDateTime<DiscordianDate> localDateTime(TemporalAccessor temporal)
localDateTime in interface Chronologytemporal - the date-time object to convert, not nullDateTimeException - if unable to create the date-timepublic ChronoZonedDateTime<DiscordianDate> zonedDateTime(TemporalAccessor temporal)
zonedDateTime in interface Chronologytemporal - the date-time object to convert, not nullDateTimeException - if unable to create the date-timepublic ChronoZonedDateTime<DiscordianDate> zonedDateTime(Instant instant, ZoneId zone)
Instant.zonedDateTime in interface Chronologyinstant - the instant to create the date-time from, not nullzone - the time-zone, not nullDateTimeException - if the result exceeds the supported rangepublic boolean isLeapYear(long prolepticYear)
A Discordian proleptic-year is leap if the remainder after division by four equals zero. There are two special cases. If the year minus 1166 is divisible by 100 it is not a leap year, unless it is also divisible by 400, when it is a leap year. These rules produce leap days on the same dates as the ISO-8601 calendar system.
isLeapYear in interface ChronologyprolepticYear - the proleptic-year to check, not validated for rangepublic int prolepticYear(Era era, int yearOfEra)
prolepticYear in interface Chronologypublic DiscordianEra eraOf(int era)
eraOf in interface Chronologypublic List<Era> eras()
eras in interface Chronologypublic ValueRange range(ChronoField field)
range in interface Chronologypublic DiscordianDate resolveDate(Map<TemporalField,Long> fieldValues, ResolverStyle resolverStyle)
resolveDate in interface ChronologyresolveDate in class AbstractChronologyCopyright © 2010–2019 ThreeTen.org. All rights reserved.