public abstract class DurationFieldType
extends java.lang.Object
implements java.io.Serializable
A duration field type defines the type of the field, such as hours.
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.
Instances of DurationFieldType
are singletons.
They can be compared using ==
.
If required, you can create your own field, for example a quarters.
You must create a subclass of DurationFieldType
that defines the field type.
This class returns the actual calculation engine from getField(Chronology)
.
Modifier and Type | Class and Description |
---|---|
private static class |
DurationFieldType.StandardDurationFieldType |
Modifier and Type | Field and Description |
---|---|
(package private) static byte |
CENTURIES |
(package private) static DurationFieldType |
CENTURIES_TYPE
The centuries field type.
|
(package private) static byte |
DAYS |
(package private) static DurationFieldType |
DAYS_TYPE
The days field type.
|
(package private) static byte |
ERAS |
(package private) static DurationFieldType |
ERAS_TYPE
The eras field type.
|
(package private) static byte |
HALFDAYS |
(package private) static DurationFieldType |
HALFDAYS_TYPE
The halfdays field type.
|
(package private) static byte |
HOURS |
(package private) static DurationFieldType |
HOURS_TYPE
The hours field type.
|
private java.lang.String |
iName
The name of the field type.
|
(package private) static byte |
MILLIS |
(package private) static DurationFieldType |
MILLIS_TYPE
The millis field type.
|
(package private) static byte |
MINUTES |
(package private) static DurationFieldType |
MINUTES_TYPE
The minutes field type.
|
(package private) static byte |
MONTHS |
(package private) static DurationFieldType |
MONTHS_TYPE
The months field type.
|
(package private) static byte |
SECONDS |
(package private) static DurationFieldType |
SECONDS_TYPE
The seconds field type.
|
private static long |
serialVersionUID
Serialization version
|
(package private) static byte |
WEEKS |
(package private) static DurationFieldType |
WEEKS_TYPE
The weeks field type.
|
(package private) static byte |
WEEKYEARS |
(package private) static DurationFieldType |
WEEKYEARS_TYPE
The weekyears field type.
|
(package private) static byte |
YEARS |
(package private) static DurationFieldType |
YEARS_TYPE
The years field type.
|
Modifier | Constructor and Description |
---|---|
protected |
DurationFieldType(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static DurationFieldType |
centuries()
Get the centuries field type.
|
static DurationFieldType |
days()
Get the days field type.
|
static DurationFieldType |
eras()
Get the eras field type.
|
abstract DurationField |
getField(Chronology chronology)
Gets a suitable field for this type from the given Chronology.
|
java.lang.String |
getName()
Get the name of the field.
|
static DurationFieldType |
halfdays()
Get the halfdays field type.
|
static DurationFieldType |
hours()
Get the hours field type.
|
boolean |
isSupported(Chronology chronology)
Checks whether this field supported in the given Chronology.
|
static DurationFieldType |
millis()
Get the millis field type.
|
static DurationFieldType |
minutes()
Get the minutes field type.
|
static DurationFieldType |
months()
Get the months field type.
|
static DurationFieldType |
seconds()
Get the seconds field type.
|
java.lang.String |
toString()
Get a suitable debug string.
|
static DurationFieldType |
weeks()
Get the weeks field type.
|
static DurationFieldType |
weekyears()
Get the weekyears field type.
|
static DurationFieldType |
years()
Get the years field type.
|
private static final long serialVersionUID
static final byte ERAS
static final byte CENTURIES
static final byte WEEKYEARS
static final byte YEARS
static final byte MONTHS
static final byte WEEKS
static final byte DAYS
static final byte HALFDAYS
static final byte HOURS
static final byte MINUTES
static final byte SECONDS
static final byte MILLIS
static final DurationFieldType ERAS_TYPE
static final DurationFieldType CENTURIES_TYPE
static final DurationFieldType WEEKYEARS_TYPE
static final DurationFieldType YEARS_TYPE
static final DurationFieldType MONTHS_TYPE
static final DurationFieldType WEEKS_TYPE
static final DurationFieldType DAYS_TYPE
static final DurationFieldType HALFDAYS_TYPE
static final DurationFieldType HOURS_TYPE
static final DurationFieldType MINUTES_TYPE
static final DurationFieldType SECONDS_TYPE
static final DurationFieldType MILLIS_TYPE
private final java.lang.String iName
protected DurationFieldType(java.lang.String name)
name
- the name to use, which by convention, are plural.public static DurationFieldType millis()
public static DurationFieldType seconds()
public static DurationFieldType minutes()
public static DurationFieldType hours()
public static DurationFieldType halfdays()
public static DurationFieldType days()
public static DurationFieldType weeks()
public static DurationFieldType weekyears()
public static DurationFieldType months()
public static DurationFieldType years()
public static DurationFieldType centuries()
public static DurationFieldType eras()
public java.lang.String getName()
public abstract DurationField 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