org.goda.time.base
public abstract class AbstractDateTime extends AbstractInstant implements ReadableDateTime
This class should generally not be used directly by API users.
The ReadableDateTime interface should be used when different
kinds of date/time objects are to be referenced.
Whenever you want to implement ReadableDateTime you should
extend this class.
AbstractDateTime subclasses may be mutable and not thread-safe.
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractDateTime()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
get(DateTimeFieldType type)
Get the value of one of the fields of a datetime.
|
int |
getCenturyOfEra()
Get the year of era field value.
|
int |
getDayOfMonth()
Get the day of month field value.
|
int |
getDayOfWeek()
Get the day of week field value.
|
int |
getDayOfYear()
Get the day of year field value.
|
int |
getEra()
Get the era field value.
|
int |
getHourOfDay()
Get the hour of day field value.
|
int |
getMillisOfDay()
Get the millis of day field value.
|
int |
getMillisOfSecond()
Get the millis of second field value.
|
int |
getMinuteOfDay()
Get the minute of day field value.
|
int |
getMinuteOfHour()
Get the minute of hour field value.
|
int |
getMonthOfYear()
Get the month of year field value.
|
int |
getSecondOfDay()
Get the second of day field value.
|
int |
getSecondOfMinute()
Get the second of minute field value.
|
int |
getWeekOfWeekyear()
Get the week of weekyear field value.
|
int |
getWeekyear()
Get the weekyear field value.
|
int |
getYear()
Get the year field value.
|
int |
getYearOfCentury()
Get the year of century field value.
|
int |
getYearOfEra()
Get the year of era field value.
|
String |
toString(String pattern)
Output the instant using the specified format pattern.
|
String |
toString(String pattern,
Locale locale)
Output the instant using the specified format pattern.
|
compareTo, equals, get, getZone, hashCode, isAfter, isAfter, isAfterNow, isBefore, isBefore, isBeforeNow, isEqual, isEqual, isEqualNow, isSupported, toDate, toDateTime, toDateTime, toDateTime, toDateTimeISO, toInstant, toMutableDateTime, toMutableDateTime, toMutableDateTime, toMutableDateTimeISO, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waittoDateTime, toMutableDateTimecompareTo, equals, getChronology, getMillis, getZone, hashCode, isAfter, isBefore, isEqual, isSupported, toInstant, toStringpublic int get(DateTimeFieldType type)
This method uses the chronology of the datetime to obtain the value. It is essentially a generic way of calling one of the get methods.
get in interface ReadableInstantget in class AbstractInstanttype - a field type, usually obtained from DateTimeFieldTypeIllegalArgumentException - if the field type is nullpublic int getEra()
getEra in interface ReadableDateTimepublic int getCenturyOfEra()
getCenturyOfEra in interface ReadableDateTimepublic int getYearOfEra()
getYearOfEra in interface ReadableDateTimepublic int getYearOfCentury()
getYearOfCentury in interface ReadableDateTimepublic int getYear()
getYear in interface ReadableDateTimepublic int getWeekyear()
getWeekyear in interface ReadableDateTimepublic int getMonthOfYear()
getMonthOfYear in interface ReadableDateTimepublic int getWeekOfWeekyear()
getWeekOfWeekyear in interface ReadableDateTimepublic int getDayOfYear()
getDayOfYear in interface ReadableDateTimepublic int getDayOfMonth()
The values for the day of month are defined in org.joda.time.DateTimeConstants.
getDayOfMonth in interface ReadableDateTimepublic int getDayOfWeek()
The values for the day of week are defined in org.joda.time.DateTimeConstants.
getDayOfWeek in interface ReadableDateTimepublic int getHourOfDay()
getHourOfDay in interface ReadableDateTimepublic int getMinuteOfDay()
getMinuteOfDay in interface ReadableDateTimepublic int getMinuteOfHour()
getMinuteOfHour in interface ReadableDateTimepublic int getSecondOfDay()
getSecondOfDay in interface ReadableDateTimepublic int getSecondOfMinute()
getSecondOfMinute in interface ReadableDateTimepublic int getMillisOfDay()
getMillisOfDay in interface ReadableDateTimepublic int getMillisOfSecond()
getMillisOfSecond in interface ReadableDateTimepublic String toString(String pattern)
toString in interface ReadableDateTimepattern - the pattern specification, null means use toStringorg.joda.time.format.DateTimeFormatpublic String toString(String pattern, Locale locale) throws IllegalArgumentException
toString in interface ReadableDateTimepattern - the pattern specification, null means use toStringlocale - Locale to use, null means defaultIllegalArgumentException - if pattern is invalidorg.joda.time.format.DateTimeFormatCopyright © 2013 os-cillation GmbH. All rights reserved.