- All Implemented Interfaces:
Serializable,Comparable<DateTime.Granularity>,java.lang.constant.Constable
- Enclosing class:
- DateTime
The desired granularity of the output.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the conversion factor from milliseconds.getField()Gets the equivalent Joda-Time field type.static DateTime.GranularityReturns the enum constant of this class with the specified name.static DateTime.Granularity[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
MILLISECOND
A unit of one millisecond. -
SECOND
A unit of one second. -
MINUTE
A unit of one minute. -
HOUR
A unit of one hour. -
DAY
A unit of one day. -
WEEK
A unit of one week -
MONTH
A unit of one month. -
YEAR
A unit of one year. -
CENTURY
A unit of one century
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getFactor
public double getFactor()Gets the conversion factor from milliseconds.- Returns:
- the divisor to produce the specified granularity from milliseconds
-
getField
Gets the equivalent Joda-Time field type.- Returns:
- the Joda-Time
DurationFieldTypefor this granularity
-