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 | 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.
|
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
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"