public abstract class BaseChronology extends Chronology implements Serializable
BaseChronology is thread-safe and immutable, and all subclasses must be as well.
| 限定符 | 构造器和说明 |
|---|---|
protected |
BaseChronology()
Restricted constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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 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 在类中 Chronologypublic abstract Chronology withUTC()
withUTC 在类中 Chronologypublic abstract Chronology withZone(DateTimeZone zone)
withZone 在类中 Chronologyzone - to use, or default if nullZonedChronologypublic long getDateTimeMillis(int year,
int monthOfYear,
int dayOfMonth,
int millisOfDay)
throws IllegalArgumentException
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
getDateTimeMillis 在类中 Chronologyyear - year to usemonthOfYear - month to usedayOfMonth - day of month to usemillisOfDay - millisecond to useIllegalArgumentException - if the values are invalidpublic long getDateTimeMillis(int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond)
throws IllegalArgumentException
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
getDateTimeMillis 在类中 Chronologyyear - year to usemonthOfYear - month to usedayOfMonth - day of month to usehourOfDay - hour to useminuteOfHour - minute to usesecondOfMinute - second to usemillisOfSecond - millisecond to useIllegalArgumentException - if the values are invalidpublic long getDateTimeMillis(long instant,
int hourOfDay,
int minuteOfHour,
int secondOfMinute,
int millisOfSecond)
throws IllegalArgumentException
The default implementation calls upon separate DateTimeFields to determine the result. Subclasses are encouraged to provide a more efficient implementation.
getDateTimeMillis 在类中 Chronologyinstant - instant to start fromhourOfDay - hour to useminuteOfHour - minute to usesecondOfMinute - second to usemillisOfSecond - millisecond to useIllegalArgumentException - if the values are invalidpublic void validate(ReadablePartial partial, int[] values)
This implementation uses DateTimeField.getMinimumValue(ReadablePartial, int[])
and DateTimeField.getMaximumValue(ReadablePartial, int[]).
validate 在类中 Chronologypartial - the partial instant to validatevalues - the values to validate, not null unless the partial is emptyIllegalArgumentException - if the instant is invalidpublic int[] get(ReadablePartial partial, long instant)
get 在类中 Chronologypartial - the partial instant to useinstant - the instant to querypublic long set(ReadablePartial partial, long instant)
set 在类中 Chronologypartial - the partial instant to useinstant - the instant to updatepublic int[] get(ReadablePeriod period, long startInstant, long endInstant)
get 在类中 Chronologyperiod - 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 在类中 Chronologyperiod - the period instant to useduration - the duration to querypublic long add(ReadablePeriod period, long instant, int scalar)
add 在类中 Chronologyperiod - 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 在类中 Chronologyinstant - the instant to add toduration - the duration to addscalar - the number of times to addpublic DurationField millis()
millis 在类中 Chronologypublic DateTimeField millisOfSecond()
millisOfSecond 在类中 Chronologypublic DateTimeField millisOfDay()
millisOfDay 在类中 Chronologypublic DurationField seconds()
seconds 在类中 Chronologypublic DateTimeField secondOfMinute()
secondOfMinute 在类中 Chronologypublic DateTimeField secondOfDay()
secondOfDay 在类中 Chronologypublic DurationField minutes()
minutes 在类中 Chronologypublic DateTimeField minuteOfHour()
minuteOfHour 在类中 Chronologypublic DateTimeField minuteOfDay()
minuteOfDay 在类中 Chronologypublic DurationField hours()
hours 在类中 Chronologypublic DateTimeField hourOfDay()
hourOfDay 在类中 Chronologypublic DateTimeField clockhourOfDay()
clockhourOfDay 在类中 Chronologypublic DurationField halfdays()
halfdays 在类中 Chronologypublic DateTimeField hourOfHalfday()
hourOfHalfday 在类中 Chronologypublic DateTimeField clockhourOfHalfday()
clockhourOfHalfday 在类中 Chronologypublic DateTimeField halfdayOfDay()
halfdayOfDay 在类中 Chronologypublic DurationField days()
days 在类中 Chronologypublic DateTimeField dayOfWeek()
DayOfWeek values are defined in
DateTimeConstants.
They use the ISO definitions, where 1 is Monday and 7 is Sunday.
dayOfWeek 在类中 Chronologypublic DateTimeField dayOfMonth()
dayOfMonth 在类中 Chronologypublic DateTimeField dayOfYear()
dayOfYear 在类中 Chronologypublic DurationField weeks()
weeks 在类中 Chronologypublic DateTimeField weekOfWeekyear()
weekOfWeekyear 在类中 Chronologypublic DurationField weekyears()
weekyears 在类中 Chronologypublic DateTimeField weekyear()
weekyear 在类中 Chronologypublic DateTimeField weekyearOfCentury()
weekyearOfCentury 在类中 Chronologypublic DurationField months()
months 在类中 Chronologypublic DateTimeField monthOfYear()
monthOfYear 在类中 Chronologypublic DurationField years()
years 在类中 Chronologypublic DateTimeField year()
year 在类中 Chronologypublic DateTimeField yearOfEra()
yearOfEra 在类中 Chronologypublic DateTimeField yearOfCentury()
yearOfCentury 在类中 Chronologypublic DurationField centuries()
centuries 在类中 Chronologypublic DateTimeField centuryOfEra()
centuryOfEra 在类中 Chronologypublic DurationField eras()
eras 在类中 Chronologypublic DateTimeField era()
era 在类中 Chronologypublic abstract String toString()
toString 在类中 ChronologyCopyright © 2020. All rights reserved.