public enum DurationFormat extends Enum<DurationFormat>
Title:
Description: A simple class to provide various formatting options for durations represented in milliseconds. The durations are displayed in terms of hours, minutes, seconds, and milliseconds.
Copyright: Copyright (c) 2009
Company: Clark & Parsia, LLC.
| Enum Constant and Description |
|---|
FULL
Format duration in full format.
|
LONG
Format duration in long format.
|
MEDIUM
Format duration in medium format (no milliseconds).
|
SHORT
Format duration in short format (no hours or milliseconds).
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(long durationInMilliseconds)
Format the given duration in milliseconds according to the style defined by this
DurationFormat class.
|
static DurationFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DurationFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DurationFormat FULL
public static final DurationFormat LONG
public static final DurationFormat MEDIUM
public static final DurationFormat SHORT
public static DurationFormat[] values()
for (DurationFormat c : DurationFormat.values()) System.out.println(c);
public static DurationFormat valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String format(long durationInMilliseconds)
durationInMilliseconds - duration represented in millisecondsCopyright © 2019. All rights reserved.