java.io.Serializable
public final class Symmetry454Chronology
extends java.time.chrono.AbstractChronology
implements java.io.Serializable
This chronology defines the rules of the Symmetry454 calendar system.
Dates are aligned such that 0001/01/01 (Sym454)
is 0001-01-01 (ISO)
.
The calendar implemented by this class is proleptic, with January 1st as the start of the year. Each month either has 28 days or 35 days, in an alternating pattern; January has 28 days, February has 35 days and March again has 28 days. Due to this, each quarter consists of 13 weeks.
Normal years thus have 364 days, whereas leap years have an extra week, aptly called leap week, added to the end, extending the year to 371 days.
The fields are defined as follows:
Modifier and Type | Field | Description |
---|---|---|
static long |
DAYS_0001_TO_1970 |
The number of days from year zero to CE 1970, still the era only allows CE 1 and higher.
|
static Symmetry454Chronology |
INSTANCE |
Singleton instance for the Symmetry454 chronology.
|
Constructor | Description |
---|---|
Symmetry454Chronology() |
Deprecated.
Use the singleton
INSTANCE instead. |
Modifier and Type | Method | Description |
---|---|---|
Symmetry454Date |
date(int prolepticYear,
int month,
int dayOfMonth) |
Obtains a local date in Symmetry454 calendar system from the
proleptic-year, month-of-year and day-of-month fields.
|
Symmetry454Date |
date(java.time.chrono.Era era,
int yearOfEra,
int month,
int dayOfMonth) |
Obtains a local date in Symmetry454 calendar system from the
era, year-of-era, month-of-year and day-of-month fields.
|
Symmetry454Date |
date(java.time.temporal.TemporalAccessor temporal) |
Obtains a Symmetry454 local date from another date-time object.
|
Symmetry454Date |
dateEpochDay(long epochDay) |
Obtains a local date in the Symmetry454 calendar system from the epoch-day.
|
Symmetry454Date |
dateNow() |
Obtains the current Symmetry454 local date from the system clock in the default time-zone.
|
Symmetry454Date |
dateNow(java.time.Clock clock) |
Obtains the current Symmetry454 local date from the specified clock.
|
Symmetry454Date |
dateNow(java.time.ZoneId zone) |
Obtains the current Symmetry454 local date from the system clock in the specified time-zone.
|
Symmetry454Date |
dateYearDay(int prolepticYear,
int dayOfYear) |
Obtains a local date in Symmetry454 calendar system from the
proleptic-year and day-of-year fields.
|
Symmetry454Date |
dateYearDay(java.time.chrono.Era era,
int yearOfEra,
int dayOfYear) |
Obtains a local date in Symmetry454 calendar system from the
era, year-of-era and day-of-year fields.
|
java.time.chrono.IsoEra |
eraOf(int eraValue) |
Creates the chronology era object from the numeric value.
|
java.util.List<java.time.chrono.Era> |
eras() |
Gets the list of eras for the chronology.
|
java.lang.String |
getCalendarType() |
Gets the calendar type of the underlying calendar system, which returns null.
|
java.lang.String |
getId() |
Gets the ID of the chronology - 'Sym454'.
|
static long |
getLeapYearsBefore(long prolepticYear) |
Get the count of leap years since CE 1.
|
boolean |
isLeapYear(long year) |
Checks if the specified year is a leap year.
|
java.time.chrono.ChronoLocalDateTime<Symmetry454Date> |
localDateTime(java.time.temporal.TemporalAccessor temporal) |
Obtains a Symmetry454 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) |
|
java.time.chrono.ChronoZonedDateTime<Symmetry454Date> |
zonedDateTime(java.time.Instant instant,
java.time.ZoneId zone) |
Obtains a Symmetry454 zoned date-time in this chronology from an
Instant . |
java.time.chrono.ChronoZonedDateTime<Symmetry454Date> |
zonedDateTime(java.time.temporal.TemporalAccessor temporal) |
Obtains a Symmetry454 zoned date-time from another date-time object.
|
compareTo, equals, hashCode, resolveDate, toString
public static final Symmetry454Chronology INSTANCE
public static final long DAYS_0001_TO_1970
@Deprecated public Symmetry454Chronology()
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 Unicode Locale Data Markup Language (LDML) specification does not define an identifier for this calendar system, thus null is returned.
getId()
public Symmetry454Date date(java.time.chrono.Era era, int yearOfEra, int month, int dayOfMonth)
era
- the Symmetry454 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 IsoEra
public Symmetry454Date 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 Symmetry454Date dateYearDay(java.time.chrono.Era era, int yearOfEra, int dayOfYear)
era
- the Symmetry454 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 IsoEra
public Symmetry454Date dateYearDay(int prolepticYear, int dayOfYear)
prolepticYear
- the proleptic-yeardayOfYear
- the day-of-yearjava.time.DateTimeException
- if unable to create the datepublic Symmetry454Date dateEpochDay(long epochDay)
epochDay
- the epoch dayjava.time.DateTimeException
- if unable to create the datepublic Symmetry454Date 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 Symmetry454Date 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 Symmetry454Date 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 Symmetry454Date 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<Symmetry454Date> 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<Symmetry454Date> 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<Symmetry454Date> 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 boolean isLeapYear(long year)
A leap-year is a year of a longer length than normal. Leap years in the calendar system match those of the ISO calendar system.
year
- the proleptic-year to check, not validated for rangepublic java.time.chrono.IsoEra eraOf(int eraValue)
The list of eras is shared with IsoEra
.
eraValue
- the era valuejava.time.DateTimeException
- if unable to create the erapublic java.util.List<java.time.chrono.Era> eras()
The list of eras is shared with IsoEra
.
public java.time.temporal.ValueRange range(java.time.temporal.ChronoField field)
public int prolepticYear(java.time.chrono.Era era, int yearOfEra)
public static long getLeapYearsBefore(long prolepticYear)
prolepticYear
- the yearCopyright © 2010–2018 ThreeTen.org. All rights reserved.