public abstract class BaseChronology extends Chronology implements java.io.Serializable
BaseChronology is thread-safe and immutable, and all subclasses must be as well.
Modifier and Type | Method and Description |
---|---|
long |
add(long instant,
long duration,
int scalar)
Adds the duration to the instant, specifying the number of times to add.
|
long |
add(ReadablePeriod period,
long instant,
int scalar)
Adds the period to the instant, specifying the number of times to add.
|
DurationField |
centuries()
Get the centuries duration field for this chronology.
|
DateTimeField |
centuryOfEra()
Get the century of era field for this chronology.
|
DateTimeField |
clockhourOfDay()
Get the hour of day (offset to 1-24) field for this chronology.
|
DateTimeField |
clockhourOfHalfday()
Get the hour of am/pm (offset to 1-12) field for this chronology.
|
DateTimeField |
dayOfMonth()
Get the day of month field for this chronology.
|
DateTimeField |
dayOfWeek()
Get the day of week field for this chronology.
|
DateTimeField |
dayOfYear()
Get the day of year field for this chronology.
|
DurationField |
days()
Get the days duration field for this chronology.
|
DateTimeField |
era()
Get the era field for this chronology.
|
DurationField |
eras()
Get the eras duration field for this chronology.
|
int[] |
get(ReadablePartial partial,
long instant)
Gets the values of a partial from an instant.
|
int[] |
get(ReadablePeriod period,
long duration)
Gets the values of a period from an interval.
|
int[] |
get(ReadablePeriod period,
long startInstant,
long endInstant)
Gets the values of a period from an interval.
|
long |
getDateTimeMillis(int year,
int monthOfYear,
int dayOfMonth,
int millisOfDay)
Returns a datetime millisecond instant, formed from the given year,
month, day, and millisecond values.
|
long |
getDateTimeMillis(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.
|
long |
getDateTimeMillis(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.
|
abstract DateTimeZone |
getZone()
Returns the DateTimeZone that this Chronology operates in, or null if
unspecified.
|
DateTimeField |
halfdayOfDay()
Get the AM(0) PM(1) field for this chronology.
|
DurationField |
halfdays()
Get the halfdays duration field for this chronology.
|
DateTimeField |
hourOfDay()
Get the hour of day (0-23) field for this chronology.
|
DateTimeField |
hourOfHalfday()
Get the hour of am/pm (0-11) field for this chronology.
|
DurationField |
hours()
Get the hours duration field for this chronology.
|
DurationField |
millis()
Get the millis duration field for this chronology.
|
DateTimeField |
millisOfDay()
Get the millis of day field for this chronology.
|
DateTimeField |
millisOfSecond()
Get the millis of second field for this chronology.
|
DateTimeField |
minuteOfDay()
Get the minute of day field for this chronology.
|
DateTimeField |
minuteOfHour()
Get the minute of hour field for this chronology.
|
DurationField |
minutes()
Get the minutes duration field for this chronology.
|
DateTimeField |
monthOfYear()
Get the month of year field for this chronology.
|
DurationField |
months()
Get the months duration field for this chronology.
|
DateTimeField |
secondOfDay()
Get the second of day field for this chronology.
|
DateTimeField |
secondOfMinute()
Get the second of minute field for this chronology.
|
DurationField |
seconds()
Get the seconds duration field for this chronology.
|
long |
set(ReadablePartial partial,
long instant)
Sets the partial into the instant.
|
abstract java.lang.String |
toString()
Gets a debugging toString.
|
void |
validate(ReadablePartial partial,
int[] values)
Validates whether the fields stored in a partial instant are valid.
|
DateTimeField |
weekOfWeekyear()
Get the week of a week based year field for this chronology.
|
DurationField |
weeks()
Get the weeks duration field for this chronology.
|
DateTimeField |
weekyear()
Get the year of a week based year field for this chronology.
|
DateTimeField |
weekyearOfCentury()
Get the year of a week based year in a century field for this chronology.
|
DurationField |
weekyears()
Get the weekyears duration field for this chronology.
|
abstract Chronology |
withUTC()
Returns an instance of this Chronology that operates in the UTC time
zone.
|
abstract Chronology |
withZone(DateTimeZone zone)
Returns an instance of this Chronology that operates in any time zone.
|
DateTimeField |
year()
Get the year field for this chronology.
|
DateTimeField |
yearOfCentury()
Get the year of century field for this chronology.
|
DateTimeField |
yearOfEra()
Get the year of era field for this chronology.
|
DurationField |
years()
Get the years duration field for this chronology.
|
public abstract DateTimeZone getZone()
getZone
in class Chronology
public abstract Chronology withUTC()
withUTC
in class Chronology
public abstract Chronology withZone(DateTimeZone zone)
withZone
in class Chronology
zone
- to use, or default if nullZonedChronology
public long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int millisOfDay) throws java.lang.IllegalArgumentException
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
getDateTimeMillis
in class Chronology
year
- year to usemonthOfYear
- month to usedayOfMonth
- day of month to usemillisOfDay
- millisecond to usejava.lang.IllegalArgumentException
- if the values are invalidpublic long getDateTimeMillis(int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws java.lang.IllegalArgumentException
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
getDateTimeMillis
in class Chronology
year
- year to usemonthOfYear
- month to usedayOfMonth
- day of month to usehourOfDay
- hour to useminuteOfHour
- minute to usesecondOfMinute
- second to usemillisOfSecond
- millisecond to usejava.lang.IllegalArgumentException
- if the values are invalidpublic long getDateTimeMillis(long instant, int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond) throws java.lang.IllegalArgumentException
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
getDateTimeMillis
in class Chronology
instant
- instant to start fromhourOfDay
- hour to useminuteOfHour
- minute to usesecondOfMinute
- second to usemillisOfSecond
- millisecond to usejava.lang.IllegalArgumentException
- if the values are invalidpublic void validate(ReadablePartial partial, int[] values)
This implementation uses DateTimeField.getMinimumValue(ReadablePartial, int[])
and DateTimeField.getMaximumValue(ReadablePartial, int[])
.
validate
in class Chronology
partial
- the partial instant to validatevalues
- the values to validate, not null unless the partial is emptyjava.lang.IllegalArgumentException
- if the instant is invalidpublic int[] get(ReadablePartial partial, long instant)
get
in class Chronology
partial
- the partial instant to useinstant
- the instant to querypublic long set(ReadablePartial partial, long instant)
set
in class Chronology
partial
- the partial instant to useinstant
- the instant to updatepublic int[] get(ReadablePeriod period, long startInstant, long endInstant)
get
in class Chronology
period
- the period instant to usestartInstant
- the start instant of an interval to queryendInstant
- the start instant of an interval to querypublic int[] get(ReadablePeriod period, long duration)
get
in class Chronology
period
- the period instant to useduration
- the duration to querypublic long add(ReadablePeriod period, long instant, int scalar)
add
in class Chronology
period
- the period to add, null means add nothinginstant
- the instant to add toscalar
- the number of times to addpublic long add(long instant, long duration, int scalar)
add
in class Chronology
instant
- the instant to add toduration
- the duration to addscalar
- the number of times to addpublic DurationField millis()
millis
in class Chronology
public DateTimeField millisOfSecond()
millisOfSecond
in class Chronology
public DateTimeField millisOfDay()
millisOfDay
in class Chronology
public DurationField seconds()
seconds
in class Chronology
public DateTimeField secondOfMinute()
secondOfMinute
in class Chronology
public DateTimeField secondOfDay()
secondOfDay
in class Chronology
public DurationField minutes()
minutes
in class Chronology
public DateTimeField minuteOfHour()
minuteOfHour
in class Chronology
public DateTimeField minuteOfDay()
minuteOfDay
in class Chronology
public DurationField hours()
hours
in class Chronology
public DateTimeField hourOfDay()
hourOfDay
in class Chronology
public DateTimeField clockhourOfDay()
clockhourOfDay
in class Chronology
public DurationField halfdays()
halfdays
in class Chronology
public DateTimeField hourOfHalfday()
hourOfHalfday
in class Chronology
public DateTimeField clockhourOfHalfday()
clockhourOfHalfday
in class Chronology
public DateTimeField halfdayOfDay()
halfdayOfDay
in class Chronology
public DurationField days()
days
in class Chronology
public DateTimeField dayOfWeek()
DayOfWeek values are defined in
DateTimeConstants
.
They use the ISO definitions, where 1 is Monday and 7 is Sunday.
dayOfWeek
in class Chronology
public DateTimeField dayOfMonth()
dayOfMonth
in class Chronology
public DateTimeField dayOfYear()
dayOfYear
in class Chronology
public DurationField weeks()
weeks
in class Chronology
public DateTimeField weekOfWeekyear()
weekOfWeekyear
in class Chronology
public DurationField weekyears()
weekyears
in class Chronology
public DateTimeField weekyear()
weekyear
in class Chronology
public DateTimeField weekyearOfCentury()
weekyearOfCentury
in class Chronology
public DurationField months()
months
in class Chronology
public DateTimeField monthOfYear()
monthOfYear
in class Chronology
public DurationField years()
years
in class Chronology
public DateTimeField year()
year
in class Chronology
public DateTimeField yearOfEra()
yearOfEra
in class Chronology
public DateTimeField yearOfCentury()
yearOfCentury
in class Chronology
public DurationField centuries()
centuries
in class Chronology
public DateTimeField centuryOfEra()
centuryOfEra
in class Chronology
public DurationField eras()
eras
in class Chronology
public DateTimeField era()
era
in class Chronology
public abstract java.lang.String toString()
toString
in class Chronology
Copyright © 2010 - 2020 Adobe. All Rights Reserved