public abstract class DateTimeFieldType
extends java.lang.Object
implements java.io.Serializable
A field type defines the type of the field, such as hourOfDay.
If does not directly enable any calculations, however it does provide a
getField(Chronology)
method that returns the actual calculation engine
for a particular chronology.
It also provides access to the related DurationFieldType
s.
Instances of DateTimeFieldType
are singletons.
They can be compared using ==
.
If required, you can create your own field, for example a quarterOfYear.
You must create a subclass of DateTimeFieldType
that defines the field type.
This class returns the actual calculation engine from getField(Chronology)
.
The subclass should implement equals and hashCode.
Modifier and Type | Class and Description |
---|---|
private static class |
DateTimeFieldType.StandardDateTimeFieldType |
Modifier and Type | Field and Description |
---|---|
(package private) static byte |
CENTURY_OF_ERA
Ordinal values for standard field types.
|
private static DateTimeFieldType |
CENTURY_OF_ERA_TYPE
The centuryOfEra field type.
|
(package private) static byte |
CLOCKHOUR_OF_DAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
CLOCKHOUR_OF_DAY_TYPE
The clockhourOfDay field type.
|
(package private) static byte |
CLOCKHOUR_OF_HALFDAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
CLOCKHOUR_OF_HALFDAY_TYPE
The clockhourOfHalfday field type.
|
(package private) static byte |
DAY_OF_MONTH
Ordinal values for standard field types.
|
private static DateTimeFieldType |
DAY_OF_MONTH_TYPE
The dayOfMonth field type.
|
(package private) static byte |
DAY_OF_WEEK
Ordinal values for standard field types.
|
private static DateTimeFieldType |
DAY_OF_WEEK_TYPE
The dayOfWeek field type.
|
(package private) static byte |
DAY_OF_YEAR
Ordinal values for standard field types.
|
private static DateTimeFieldType |
DAY_OF_YEAR_TYPE
The dayOfYear field type.
|
(package private) static byte |
ERA
Ordinal values for standard field types.
|
private static DateTimeFieldType |
ERA_TYPE
The era field type.
|
(package private) static byte |
HALFDAY_OF_DAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
HALFDAY_OF_DAY_TYPE
The halfday field type.
|
(package private) static byte |
HOUR_OF_DAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
HOUR_OF_DAY_TYPE
The hourOfDay field type.
|
(package private) static byte |
HOUR_OF_HALFDAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
HOUR_OF_HALFDAY_TYPE
The hourOfHalfday field type.
|
private java.lang.String |
iName
The name of the field.
|
(package private) static byte |
MILLIS_OF_DAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
MILLIS_OF_DAY_TYPE
The millisOfDay field type.
|
(package private) static byte |
MILLIS_OF_SECOND
Ordinal values for standard field types.
|
private static DateTimeFieldType |
MILLIS_OF_SECOND_TYPE
The millisOfSecond field type.
|
(package private) static byte |
MINUTE_OF_DAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
MINUTE_OF_DAY_TYPE
The minuteOfDay field type.
|
(package private) static byte |
MINUTE_OF_HOUR
Ordinal values for standard field types.
|
private static DateTimeFieldType |
MINUTE_OF_HOUR_TYPE
The minuteOfHour field type.
|
(package private) static byte |
MONTH_OF_YEAR
Ordinal values for standard field types.
|
private static DateTimeFieldType |
MONTH_OF_YEAR_TYPE
The monthOfYear field type.
|
(package private) static byte |
SECOND_OF_DAY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
SECOND_OF_DAY_TYPE
The secondOfDay field type.
|
(package private) static byte |
SECOND_OF_MINUTE
Ordinal values for standard field types.
|
private static DateTimeFieldType |
SECOND_OF_MINUTE_TYPE
The secondOfMinute field type.
|
private static long |
serialVersionUID
Serialization version
|
(package private) static byte |
WEEK_OF_WEEKYEAR
Ordinal values for standard field types.
|
private static DateTimeFieldType |
WEEK_OF_WEEKYEAR_TYPE
The weekOfWeekyear field type.
|
(package private) static byte |
WEEKYEAR
Ordinal values for standard field types.
|
(package private) static byte |
WEEKYEAR_OF_CENTURY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
WEEKYEAR_OF_CENTURY_TYPE
The weekyearOfCentury field type.
|
private static DateTimeFieldType |
WEEKYEAR_TYPE
The weekyear field type.
|
(package private) static byte |
YEAR
Ordinal values for standard field types.
|
(package private) static byte |
YEAR_OF_CENTURY
Ordinal values for standard field types.
|
private static DateTimeFieldType |
YEAR_OF_CENTURY_TYPE
The yearOfCentury field type.
|
(package private) static byte |
YEAR_OF_ERA
Ordinal values for standard field types.
|
private static DateTimeFieldType |
YEAR_OF_ERA_TYPE
The yearOfEra field type.
|
private static DateTimeFieldType |
YEAR_TYPE
The year field type.
|
Modifier | Constructor and Description |
---|---|
protected |
DateTimeFieldType(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static DateTimeFieldType |
centuryOfEra()
Get the century of era field type.
|
static DateTimeFieldType |
clockhourOfDay()
Get the hour of day (offset to 1-24) field type.
|
static DateTimeFieldType |
clockhourOfHalfday()
Get the hour of am/pm (offset to 1-12) field type.
|
static DateTimeFieldType |
dayOfMonth()
Get the day of month field type.
|
static DateTimeFieldType |
dayOfWeek()
Get the day of week field type.
|
static DateTimeFieldType |
dayOfYear()
Get the day of year field type.
|
static DateTimeFieldType |
era()
Get the era field type.
|
abstract DurationFieldType |
getDurationType()
Get the duration unit of the field.
|
abstract DateTimeField |
getField(Chronology chronology)
Gets a suitable field for this type from the given Chronology.
|
java.lang.String |
getName()
Get the name of the field.
|
abstract DurationFieldType |
getRangeDurationType()
Get the duration range of the field.
|
static DateTimeFieldType |
halfdayOfDay()
Get the AM(0) PM(1) field type.
|
static DateTimeFieldType |
hourOfDay()
Get the hour of day (0-23) field type.
|
static DateTimeFieldType |
hourOfHalfday()
Get the hour of am/pm (0-11) field type.
|
boolean |
isSupported(Chronology chronology)
Checks whether this field supported in the given Chronology.
|
static DateTimeFieldType |
millisOfDay()
Get the millis of day field type.
|
static DateTimeFieldType |
millisOfSecond()
Get the millis of second field type.
|
static DateTimeFieldType |
minuteOfDay()
Get the minute of day field type.
|
static DateTimeFieldType |
minuteOfHour()
Get the minute of hour field type.
|
static DateTimeFieldType |
monthOfYear()
Get the month of year field type.
|
static DateTimeFieldType |
secondOfDay()
Get the second of day field type.
|
static DateTimeFieldType |
secondOfMinute()
Get the second of minute field type.
|
java.lang.String |
toString()
Get a suitable debug string.
|
static DateTimeFieldType |
weekOfWeekyear()
Get the week of a week based year field type.
|
static DateTimeFieldType |
weekyear()
Get the year of a week based year field type.
|
static DateTimeFieldType |
weekyearOfCentury()
Get the year of a week based year within a century field type.
|
static DateTimeFieldType |
year()
Get the year field type.
|
static DateTimeFieldType |
yearOfCentury()
Get the year of century field type.
|
static DateTimeFieldType |
yearOfEra()
Get the year of era field type.
|
private static final long serialVersionUID
static final byte ERA
static final byte YEAR_OF_ERA
static final byte CENTURY_OF_ERA
static final byte YEAR_OF_CENTURY
static final byte YEAR
static final byte DAY_OF_YEAR
static final byte MONTH_OF_YEAR
static final byte DAY_OF_MONTH
static final byte WEEKYEAR_OF_CENTURY
static final byte WEEKYEAR
static final byte WEEK_OF_WEEKYEAR
static final byte DAY_OF_WEEK
static final byte HALFDAY_OF_DAY
static final byte HOUR_OF_HALFDAY
static final byte CLOCKHOUR_OF_HALFDAY
static final byte CLOCKHOUR_OF_DAY
static final byte HOUR_OF_DAY
static final byte MINUTE_OF_DAY
static final byte MINUTE_OF_HOUR
static final byte SECOND_OF_DAY
static final byte SECOND_OF_MINUTE
static final byte MILLIS_OF_DAY
static final byte MILLIS_OF_SECOND
private static final DateTimeFieldType ERA_TYPE
private static final DateTimeFieldType YEAR_OF_ERA_TYPE
private static final DateTimeFieldType CENTURY_OF_ERA_TYPE
private static final DateTimeFieldType YEAR_OF_CENTURY_TYPE
private static final DateTimeFieldType YEAR_TYPE
private static final DateTimeFieldType DAY_OF_YEAR_TYPE
private static final DateTimeFieldType MONTH_OF_YEAR_TYPE
private static final DateTimeFieldType DAY_OF_MONTH_TYPE
private static final DateTimeFieldType WEEKYEAR_OF_CENTURY_TYPE
private static final DateTimeFieldType WEEKYEAR_TYPE
private static final DateTimeFieldType WEEK_OF_WEEKYEAR_TYPE
private static final DateTimeFieldType DAY_OF_WEEK_TYPE
private static final DateTimeFieldType HALFDAY_OF_DAY_TYPE
private static final DateTimeFieldType HOUR_OF_HALFDAY_TYPE
private static final DateTimeFieldType CLOCKHOUR_OF_HALFDAY_TYPE
private static final DateTimeFieldType CLOCKHOUR_OF_DAY_TYPE
private static final DateTimeFieldType HOUR_OF_DAY_TYPE
private static final DateTimeFieldType MINUTE_OF_DAY_TYPE
private static final DateTimeFieldType MINUTE_OF_HOUR_TYPE
private static final DateTimeFieldType SECOND_OF_DAY_TYPE
private static final DateTimeFieldType SECOND_OF_MINUTE_TYPE
private static final DateTimeFieldType MILLIS_OF_DAY_TYPE
private static final DateTimeFieldType MILLIS_OF_SECOND_TYPE
private final java.lang.String iName
protected DateTimeFieldType(java.lang.String name)
name
- the name to usepublic static DateTimeFieldType millisOfSecond()
public static DateTimeFieldType millisOfDay()
public static DateTimeFieldType secondOfMinute()
public static DateTimeFieldType secondOfDay()
public static DateTimeFieldType minuteOfHour()
public static DateTimeFieldType minuteOfDay()
public static DateTimeFieldType hourOfDay()
public static DateTimeFieldType clockhourOfDay()
public static DateTimeFieldType hourOfHalfday()
public static DateTimeFieldType clockhourOfHalfday()
public static DateTimeFieldType halfdayOfDay()
public static DateTimeFieldType dayOfWeek()
public static DateTimeFieldType dayOfMonth()
public static DateTimeFieldType dayOfYear()
public static DateTimeFieldType weekOfWeekyear()
public static DateTimeFieldType weekyear()
public static DateTimeFieldType weekyearOfCentury()
public static DateTimeFieldType monthOfYear()
public static DateTimeFieldType year()
public static DateTimeFieldType yearOfEra()
public static DateTimeFieldType yearOfCentury()
public static DateTimeFieldType centuryOfEra()
public static DateTimeFieldType era()
public java.lang.String getName()
By convention, names follow a pattern of "dddOfRrr", where "ddd" represents the (singular) duration unit field name and "Rrr" represents the (singular) duration range field name. If the range field is not applicable, then the name of the field is simply the (singular) duration field name.
public abstract DurationFieldType getDurationType()
public abstract DurationFieldType getRangeDurationType()
public abstract DateTimeField getField(Chronology chronology)
chronology
- the chronology to use, null means ISOChronology in default zonepublic boolean isSupported(Chronology chronology)
chronology
- the chronology to use, null means ISOChronology in default zonepublic java.lang.String toString()
toString
in class java.lang.Object