|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.joda.time.Chronology
org.joda.time.chrono.BaseChronology
public abstract class BaseChronology
BaseChronology provides a skeleton implementation for chronology classes. Many utility methods are defined, but all fields are unsupported.
BaseChronology is thread-safe and immutable, and all subclasses must be as well.
| Constructor Summary | |
|---|---|
protected |
BaseChronology()
Restricted constructor. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected BaseChronology()
| Method Detail |
|---|
public abstract DateTimeZone getZone()
getZone in class Chronologypublic abstract Chronology withUTC()
withUTC in class Chronologypublic abstract Chronology withZone(DateTimeZone zone)
withZone in class Chronologyzone - to use, or default if null
ZonedChronology
public 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 in class Chronologyyear - year to usemonthOfYear - month to usedayOfMonth - day of month to usemillisOfDay - millisecond to use
IllegalArgumentException - if the values are invalid
public 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 in class Chronologyyear - year to usemonthOfYear - month to usedayOfMonth - day of month to usehourOfDay - hour to useminuteOfHour - minute to usesecondOfMinute - second to usemillisOfSecond - millisecond to use
IllegalArgumentException - if the values are invalid
public 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 in class Chronologyinstant - instant to start fromhourOfDay - hour to useminuteOfHour - minute to usesecondOfMinute - second to usemillisOfSecond - millisecond to use
IllegalArgumentException - if the values are invalid
public void validate(ReadablePartial partial,
int[] values)
This implementation uses DateTimeField.getMinimumValue(ReadablePartial, int[])
and DateTimeField.getMaximumValue(ReadablePartial, int[]).
validate in class Chronologypartial - the partial instant to validatevalues - the values to validate, not null
IllegalArgumentException - if the instant is invalid
public int[] get(ReadablePartial partial,
long instant)
get in class Chronologypartial - the partial instant to useinstant - the instant to query
public long set(ReadablePartial partial,
long instant)
set in class Chronologypartial - the partial instant to useinstant - the instant to update
public int[] get(ReadablePeriod period,
long startInstant,
long endInstant)
get in class Chronologyperiod - the period instant to usestartInstant - the start instant of an interval to queryendInstant - the start instant of an interval to query
public int[] get(ReadablePeriod period,
long duration)
get in class Chronologyperiod - the period instant to useduration - the duration to query
public long add(ReadablePeriod period,
long instant,
int scalar)
add in class Chronologyperiod - the period to add, null means add nothinginstant - the instant to add toscalar - the number of times to add
public long add(long instant,
long duration,
int scalar)
add in class Chronologyinstant - the instant to add toduration - the duration to addscalar - the number of times to add
public DurationField millis()
millis in class Chronologypublic DateTimeField millisOfSecond()
millisOfSecond in class Chronologypublic DateTimeField millisOfDay()
millisOfDay in class Chronologypublic DurationField seconds()
seconds in class Chronologypublic DateTimeField secondOfMinute()
secondOfMinute in class Chronologypublic DateTimeField secondOfDay()
secondOfDay in class Chronologypublic DurationField minutes()
minutes in class Chronologypublic DateTimeField minuteOfHour()
minuteOfHour in class Chronologypublic DateTimeField minuteOfDay()
minuteOfDay in class Chronologypublic DurationField hours()
hours in class Chronologypublic DateTimeField hourOfDay()
hourOfDay in class Chronologypublic DateTimeField clockhourOfDay()
clockhourOfDay in class Chronologypublic DurationField halfdays()
halfdays in class Chronologypublic DateTimeField hourOfHalfday()
hourOfHalfday in class Chronologypublic DateTimeField clockhourOfHalfday()
clockhourOfHalfday in class Chronologypublic DateTimeField halfdayOfDay()
halfdayOfDay in class Chronologypublic DurationField days()
days in class Chronologypublic DateTimeField dayOfWeek()
DayOfWeek values are defined in
DateTimeConstants.
They use the ISO definitions, where 1 is Monday and 7 is Sunday.
dayOfWeek in class Chronologypublic DateTimeField dayOfMonth()
dayOfMonth in class Chronologypublic DateTimeField dayOfYear()
dayOfYear in class Chronologypublic DurationField weeks()
weeks in class Chronologypublic DateTimeField weekOfWeekyear()
weekOfWeekyear in class Chronologypublic DurationField weekyears()
weekyears in class Chronologypublic DateTimeField weekyear()
weekyear in class Chronologypublic DateTimeField weekyearOfCentury()
weekyearOfCentury in class Chronologypublic DurationField months()
months in class Chronologypublic DateTimeField monthOfYear()
monthOfYear in class Chronologypublic DurationField years()
years in class Chronologypublic DateTimeField year()
year in class Chronologypublic DateTimeField yearOfEra()
yearOfEra in class Chronologypublic DateTimeField yearOfCentury()
yearOfCentury in class Chronologypublic DurationField centuries()
centuries in class Chronologypublic DateTimeField centuryOfEra()
centuryOfEra in class Chronologypublic DurationField eras()
eras in class Chronologypublic DateTimeField era()
era in class Chronologypublic abstract String toString()
toString in class Chronology
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||