Class AssembledChronology
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BuddhistChronology,CopticChronology,EthiopicChronology,GJChronology,GregorianChronology,IslamicChronology,ISOChronology,JulianChronology,LenientChronology,LimitChronology,StrictChronology,ZonedChronology
AssembledChronology is thread-safe and immutable.
- Since:
- 1.0
- Author:
- Brian S O'Neill
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA container of fields used for assembling a chronology. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAssembledChronology(Chronology base, Object param) Constructor calls the assemble method, enabling subclasses to define its supported fields. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidassemble(AssembledChronology.Fields fields) Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields.final DurationFieldGet the centuries duration field for this chronology.final DateTimeFieldGet the century of era field for this chronology.final DateTimeFieldGet the hour of day (offset to 1-24) field for this chronology.final DateTimeFieldGet the hour of am/pm (offset to 1-12) field for this chronology.final DateTimeFieldGet the day of month field for this chronology.final DateTimeFieldGet the day of week field for this chronology.final DateTimeFieldGet the day of year field for this chronology.final DurationFielddays()Get the days duration field for this chronology.final DateTimeFieldera()Get the era field for this chronology.final DurationFielderas()Get the eras duration field for this chronology.protected final ChronologygetBase()Returns the same base chronology as passed into the constructor.longgetDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay) Returns a datetime millisecond instant, formed from the given year, month, day, and millisecond values.longgetDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) Returns a datetime millisecond instant, formed from the given year, month, day, hour, minute, second, and millisecond values.longgetDateTimeMillis(long instant, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) Returns a datetime millisecond instant, from from the given instant, hour, minute, second, and millisecond values.protected final ObjectgetParam()Returns the same param object as passed into the constructor.getZone()Returns the DateTimeZone that this Chronology operates in, or null if unspecified.final DateTimeFieldGet the AM(0) PM(1) field for this chronology.final DurationFieldhalfdays()Get the halfdays duration field for this chronology.final DateTimeFieldGet the hour of day (0-23) field for this chronology.final DateTimeFieldGet the hour of am/pm (0-11) field for this chronology.final DurationFieldhours()Get the hours duration field for this chronology.final DurationFieldmillis()Get the millis duration field for this chronology.final DateTimeFieldGet the millis of day field for this chronology.final DateTimeFieldGet the millis of second field for this chronology.final DateTimeFieldGet the minute of day field for this chronology.final DateTimeFieldGet the minute of hour field for this chronology.final DurationFieldminutes()Get the minutes duration field for this chronology.final DateTimeFieldGet the month of year field for this chronology.final DurationFieldmonths()Get the months duration field for this chronology.final DateTimeFieldGet the second of day field for this chronology.final DateTimeFieldGet the second of minute field for this chronology.final DurationFieldseconds()Get the seconds duration field for this chronology.final DateTimeFieldGet the week of a week based year field for this chronology.final DurationFieldweeks()Get the weeks duration field for this chronology.final DateTimeFieldweekyear()Get the year of a week based year field for this chronology.final DateTimeFieldGet the year of a week based year in a century field for this chronology.final DurationFieldGet the weekyears duration field for this chronology.final DateTimeFieldyear()Get the year field for this chronology.final DateTimeFieldGet the year of century field for this chronology.final DateTimeFieldGet the year of era field for this chronology.final DurationFieldyears()Get the years duration field for this chronology.
-
Constructor Details
-
AssembledChronology
Constructor calls the assemble method, enabling subclasses to define its supported fields. If a base chronology is supplied, the field set initially contains references to each base chronology field.Other methods in this class will delegate to the base chronology, if it can be determined that the base chronology will produce the same results as AbstractChronology.
- Parameters:
base- optional base chronology to copy initial fields fromparam- optional param object available for assemble method
-
-
Method Details
-
getZone
Description copied from class:BaseChronologyReturns the DateTimeZone that this Chronology operates in, or null if unspecified.- Specified by:
getZonein classBaseChronology- Returns:
- DateTimeZone null if unspecified
-
getDateTimeMillis
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay) throws IllegalArgumentException Description copied from class:BaseChronologyReturns a datetime millisecond instant, formed from the given year, month, day, and millisecond values. The set of given values must refer to a valid datetime, or else an IllegalArgumentException is thrown.The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
- Overrides:
getDateTimeMillisin classBaseChronology- Parameters:
year- year to usemonthOfYear- month to usedayOfMonth- day of month to usemillisOfDay- millisecond to use- Returns:
- millisecond instant from 1970-01-01T00:00:00Z
- Throws:
IllegalArgumentException- if the values are invalid
-
getDateTimeMillis
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws IllegalArgumentException Description copied from class:BaseChronologyReturns a datetime millisecond instant, formed from the given year, month, day, hour, minute, second, and millisecond values. The set of given values must refer to a valid datetime, or else an IllegalArgumentException is thrown.The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
- Overrides:
getDateTimeMillisin classBaseChronology- Parameters:
year- year to usemonthOfYear- month to usedayOfMonth- day of month to usehourOfDay- hour to useminuteOfHour- minute to usesecondOfMinute- second to usemillisOfSecond- millisecond to use- Returns:
- millisecond instant from 1970-01-01T00:00:00Z
- Throws:
IllegalArgumentException- if the values are invalid
-
getDateTimeMillis
public long getDateTimeMillis(long instant, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws IllegalArgumentException Description copied from class:BaseChronologyReturns a datetime millisecond instant, from from the given instant, hour, minute, second, and millisecond values. The set of given values must refer to a valid datetime, or else an IllegalArgumentException is thrown.The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
- Overrides:
getDateTimeMillisin classBaseChronology- Parameters:
instant- instant to start fromhourOfDay- hour to useminuteOfHour- minute to usesecondOfMinute- second to usemillisOfSecond- millisecond to use- Returns:
- millisecond instant from 1970-01-01T00:00:00Z
- Throws:
IllegalArgumentException- if the values are invalid
-
millis
Description copied from class:BaseChronologyGet the millis duration field for this chronology.- Overrides:
millisin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
millisOfSecond
Description copied from class:BaseChronologyGet the millis of second field for this chronology.- Overrides:
millisOfSecondin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
millisOfDay
Description copied from class:BaseChronologyGet the millis of day field for this chronology.- Overrides:
millisOfDayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
seconds
Description copied from class:BaseChronologyGet the seconds duration field for this chronology.- Overrides:
secondsin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
secondOfMinute
Description copied from class:BaseChronologyGet the second of minute field for this chronology.- Overrides:
secondOfMinutein classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
secondOfDay
Description copied from class:BaseChronologyGet the second of day field for this chronology.- Overrides:
secondOfDayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
minutes
Description copied from class:BaseChronologyGet the minutes duration field for this chronology.- Overrides:
minutesin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
minuteOfHour
Description copied from class:BaseChronologyGet the minute of hour field for this chronology.- Overrides:
minuteOfHourin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
minuteOfDay
Description copied from class:BaseChronologyGet the minute of day field for this chronology.- Overrides:
minuteOfDayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
hours
Description copied from class:BaseChronologyGet the hours duration field for this chronology.- Overrides:
hoursin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
hourOfDay
Description copied from class:BaseChronologyGet the hour of day (0-23) field for this chronology.- Overrides:
hourOfDayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
clockhourOfDay
Description copied from class:BaseChronologyGet the hour of day (offset to 1-24) field for this chronology.- Overrides:
clockhourOfDayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
halfdays
Description copied from class:BaseChronologyGet the halfdays duration field for this chronology.- Overrides:
halfdaysin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
hourOfHalfday
Description copied from class:BaseChronologyGet the hour of am/pm (0-11) field for this chronology.- Overrides:
hourOfHalfdayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
clockhourOfHalfday
Description copied from class:BaseChronologyGet the hour of am/pm (offset to 1-12) field for this chronology.- Overrides:
clockhourOfHalfdayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
halfdayOfDay
Description copied from class:BaseChronologyGet the AM(0) PM(1) field for this chronology.- Overrides:
halfdayOfDayin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
days
Description copied from class:BaseChronologyGet the days duration field for this chronology.- Overrides:
daysin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
dayOfWeek
Description copied from class:BaseChronologyGet the day of week field for this chronology.DayOfWeek values are defined in
DateTimeConstants. They use the ISO definitions, where 1 is Monday and 7 is Sunday.- Overrides:
dayOfWeekin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
dayOfMonth
Description copied from class:BaseChronologyGet the day of month field for this chronology.- Overrides:
dayOfMonthin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
dayOfYear
Description copied from class:BaseChronologyGet the day of year field for this chronology.- Overrides:
dayOfYearin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
weeks
Description copied from class:BaseChronologyGet the weeks duration field for this chronology.- Overrides:
weeksin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
weekOfWeekyear
Description copied from class:BaseChronologyGet the week of a week based year field for this chronology.- Overrides:
weekOfWeekyearin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
weekyears
Description copied from class:BaseChronologyGet the weekyears duration field for this chronology.- Overrides:
weekyearsin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
weekyear
Description copied from class:BaseChronologyGet the year of a week based year field for this chronology.- Overrides:
weekyearin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
weekyearOfCentury
Description copied from class:BaseChronologyGet the year of a week based year in a century field for this chronology.- Overrides:
weekyearOfCenturyin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
months
Description copied from class:BaseChronologyGet the months duration field for this chronology.- Overrides:
monthsin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
monthOfYear
Description copied from class:BaseChronologyGet the month of year field for this chronology.- Overrides:
monthOfYearin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
years
Description copied from class:BaseChronologyGet the years duration field for this chronology.- Overrides:
yearsin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
year
Description copied from class:BaseChronologyGet the year field for this chronology.- Overrides:
yearin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
yearOfEra
Description copied from class:BaseChronologyGet the year of era field for this chronology.- Overrides:
yearOfErain classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
yearOfCentury
Description copied from class:BaseChronologyGet the year of century field for this chronology.- Overrides:
yearOfCenturyin classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
centuries
Description copied from class:BaseChronologyGet the centuries duration field for this chronology.- Overrides:
centuriesin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
centuryOfEra
Description copied from class:BaseChronologyGet the century of era field for this chronology.- Overrides:
centuryOfErain classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
eras
Description copied from class:BaseChronologyGet the eras duration field for this chronology.- Overrides:
erasin classBaseChronology- Returns:
- DurationField or UnsupportedDurationField if unsupported
-
era
Description copied from class:BaseChronologyGet the era field for this chronology.- Overrides:
erain classBaseChronology- Returns:
- DateTimeField or UnsupportedDateTimeField if unsupported
-
assemble
Invoked by the constructor and after deserialization to allow subclasses to define all of its supported fields. All unset fields default to unsupported instances.- Parameters:
fields- container of fields
-
getBase
Returns the same base chronology as passed into the constructor.- Returns:
- the base chronology
-
getParam
Returns the same param object as passed into the constructor.- Returns:
- the object parameter
-