|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.joda.time.DurationFieldType
public abstract class DurationFieldType
Identifies a duration field, such as years or minutes, in a chronology-neutral way.
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)
.
Constructor Summary | |
---|---|
protected |
DurationFieldType(String name)
Constructor. |
Method Summary | |
---|---|
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. |
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected DurationFieldType(String name)
name
- the name to use, which by convention, are plural.Method Detail |
---|
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 String getName()
public abstract DurationField getField(Chronology chronology)
chronology
- the chronology to use, null means ISOChronology in default zone
public boolean isSupported(Chronology chronology)
chronology
- the chronology to use, null means ISOChronology in default zone
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |