public final class Symmetry010Chronology extends AbstractChronology implements Serializable
This chronology defines the rules of the Symmetry010 calendar system.
Dates are aligned such that 0001/01/01 (Sym010) 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 30 days or 31 days, in an alternating pattern; January has 30 days, February has 31 days and March again has 30 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. Thus, December in a leap year has 37 days.
The fields are defined as follows:
| Modifier and Type | Field and 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 Symmetry010Chronology |
INSTANCE
Singleton instance for the Symmetry010 chronology.
|
| Constructor and Description |
|---|
Symmetry010Chronology()
Deprecated.
Use the singleton
INSTANCE instead. |
| Modifier and Type | Method and Description |
|---|---|
Symmetry010Date |
date(Era era,
int yearOfEra,
int month,
int dayOfMonth)
Obtains a local date in Symmetry010 calendar system from the
era, year-of-era, month-of-year and day-of-month fields.
|
Symmetry010Date |
date(int prolepticYear,
int month,
int dayOfMonth)
Obtains a local date in Symmetry010 calendar system from the
proleptic-year, month-of-year and day-of-month fields.
|
Symmetry010Date |
date(TemporalAccessor temporal)
Obtains a Symmetry010 local date from another date-time object.
|
Symmetry010Date |
dateEpochDay(long epochDay)
Obtains a local date in the Symmetry010 calendar system from the epoch-day.
|
Symmetry010Date |
dateNow()
Obtains the current Symmetry010 local date from the system clock in the default time-zone.
|
Symmetry010Date |
dateNow(Clock clock)
Obtains the current Symmetry010 local date from the specified clock.
|
Symmetry010Date |
dateNow(ZoneId zone)
Obtains the current Symmetry010 local date from the system clock in the specified time-zone.
|
Symmetry010Date |
dateYearDay(Era era,
int yearOfEra,
int dayOfYear)
Obtains a local date in Symmetry010 calendar system from the
era, year-of-era and day-of-year fields.
|
Symmetry010Date |
dateYearDay(int prolepticYear,
int dayOfYear)
Obtains a local date in Symmetry010 calendar system from the
proleptic-year and day-of-year fields.
|
IsoEra |
eraOf(int eraValue)
Creates the chronology era object from the numeric value.
|
List<Era> |
eras()
Gets the list of eras for the chronology.
|
String |
getCalendarType()
Gets the calendar type of the underlying calendar system, which returns null.
|
String |
getId()
Gets the ID of the chronology - 'Sym010'.
|
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.
|
ChronoLocalDateTime<Symmetry010Date> |
localDateTime(TemporalAccessor temporal)
Obtains a Symmetry010 local date-time from another date-time object.
|
int |
prolepticYear(Era era,
int yearOfEra) |
ValueRange |
range(ChronoField field) |
ChronoZonedDateTime<Symmetry010Date> |
zonedDateTime(Instant instant,
ZoneId zone)
Obtains a Symmetry010 zoned date-time in this chronology from an
Instant. |
ChronoZonedDateTime<Symmetry010Date> |
zonedDateTime(TemporalAccessor temporal)
Obtains a Symmetry010 zoned date-time from another date-time object.
|
compareTo, equals, hashCode, resolveDate, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitfrom, getDisplayName, periodpublic static final Symmetry010Chronology INSTANCE
public static final long DAYS_0001_TO_1970
@Deprecated public Symmetry010Chronology()
INSTANCE instead.ServiceLoader.public String getId()
The ID uniquely identifies the Chronology.
It can be used to lookup the Chronology using AbstractChronology.of(String).
getId in interface ChronologygetCalendarType()public String getCalendarType()
The Unicode Locale Data Markup Language (LDML) specification does not define an identifier for this calendar system, thus null is returned.
getCalendarType in interface ChronologygetId()public Symmetry010Date date(Era era, int yearOfEra, int month, int dayOfMonth)
date in interface Chronologyera - the Symmetry010 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 IsoErapublic Symmetry010Date 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 Symmetry010Date dateYearDay(Era era, int yearOfEra, int dayOfYear)
dateYearDay in interface Chronologyera - the Symmetry010 era, not nullyearOfEra - the year-of-eradayOfYear - the day-of-yearDateTimeException - if unable to create the dateClassCastException - if the era is not a IsoErapublic Symmetry010Date dateYearDay(int prolepticYear, int dayOfYear)
dateYearDay in interface ChronologyprolepticYear - the proleptic-yeardayOfYear - the day-of-yearDateTimeException - if unable to create the datepublic Symmetry010Date dateEpochDay(long epochDay)
dateEpochDay in interface ChronologyepochDay - the epoch dayDateTimeException - if unable to create the datepublic Symmetry010Date 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 Symmetry010Date 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 Symmetry010Date 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 Symmetry010Date date(TemporalAccessor temporal)
date in interface Chronologytemporal - the date-time object to convert, not nullDateTimeException - if unable to create the datepublic ChronoLocalDateTime<Symmetry010Date> localDateTime(TemporalAccessor temporal)
localDateTime in interface Chronologytemporal - the date-time object to convert, not nullDateTimeException - if unable to create the date-timepublic ChronoZonedDateTime<Symmetry010Date> zonedDateTime(TemporalAccessor temporal)
zonedDateTime in interface Chronologytemporal - the date-time object to convert, not nullDateTimeException - if unable to create the date-timepublic ChronoZonedDateTime<Symmetry010Date> 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 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.
isLeapYear in interface Chronologyyear - the proleptic-year to check, not validated for rangepublic IsoEra eraOf(int eraValue)
The list of eras is shared with IsoEra.
eraOf in interface ChronologyeraValue - the era valueDateTimeException - if unable to create the erapublic List<Era> eras()
The list of eras is shared with IsoEra.
eras in interface Chronologypublic ValueRange range(ChronoField field)
range in interface Chronologypublic int prolepticYear(Era era, int yearOfEra)
prolepticYear in interface Chronologypublic static long getLeapYearsBefore(long prolepticYear)
prolepticYear - the yearCopyright © 2010–2016 ThreeTen.org. All rights reserved.