JavaScript is disabled on your browser.
Enum Constant Summary
Enum Constants
Compact format such as "1d 2h 3m 4s" omitting milliseconds.
Compact format that includes milliseconds, e.g.
Debug output including all units down to nanoseconds.
Digital clock-style formatting such as "01:22:05".
Digital formatting including milliseconds such as "00:10.532".
ISO-8601 duration format, such as "PT30S" or "P2DT3H".
Returns only the largest non-zero component, e.g.
Returns the first two non-zero components, e.g.
Verbose English format, e.g.
Verbose format without a conjunction, e.g.
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
Converts a nanosecond duration into a formatted string.
Returns the enum constant of this class with the specified name.
Returns an array containing the constants of this enum class, in
the order they are declared.
Methods inherited from class java.lang.Enum
clone , compareTo , describeConstable , equals , finalize , getDeclaringClass , hashCode , name , ordinal , toString , valueOf
Enum Constant Details
COMPACT
Compact format such as "1d 2h 3m 4s" omitting milliseconds.
COMPACT_MILLIS
Compact format that includes milliseconds, e.g. "3s 250ms".
VERBOSE
Verbose English format, e.g. "2 days, 3 hours and 4 minutes".
VERBOSE_SIMPLE
Verbose format without a conjunction, e.g. "2 days, 3 hours, 4 minutes".
DIGITAL
Digital clock-style formatting such as "01:22:05".
DIGITAL_MILLIS
Digital formatting including milliseconds such as "00:10.532".
MINIMAL
Returns only the largest non-zero component, e.g. "3h" or "20m".
MINIMAL_TWO
Returns the first two non-zero components, e.g. "3h 20m".
ISO_8601
ISO-8601 duration format, such as "PT30S" or "P2DT3H".
DEBUG
Debug output including all units down to nanoseconds.
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 name
NullPointerException - if the argument is null
apply
public abstract String apply (long nanos)
Converts a nanosecond duration into a formatted string.
Parameters:
nanos - duration in nanoseconds
Returns:
formatted representation of the duration