public enum TimeUnit extends Enum<TimeUnit>
Enum Constant and Description |
---|
DAYS |
HOURS |
MICROSECONDS |
MILLISECONDS |
MINUTES |
NANOSECONDS |
SECONDS |
Modifier and Type | Method and Description |
---|---|
abstract long |
convert(long sourceDuration,
TimeUnit sourceUnit) |
abstract long |
toDays(long duration) |
abstract long |
toHours(long duration) |
abstract long |
toMicros(long duration) |
abstract long |
toMillis(long duration) |
abstract long |
toMinutes(long duration) |
abstract long |
toNanos(long duration) |
abstract long |
toSeconds(long duration) |
static TimeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TimeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
compareTo, createValueOfMap, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf, valueOf
$isInstance
public static final TimeUnit NANOSECONDS
public static final TimeUnit MICROSECONDS
public static final TimeUnit MILLISECONDS
public static final TimeUnit SECONDS
public static final TimeUnit MINUTES
public static final TimeUnit HOURS
public static final TimeUnit DAYS
public static TimeUnit[] values()
for (TimeUnit c : TimeUnit.values()) System.out.println(c);
public static TimeUnit 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 abstract long convert(long sourceDuration, TimeUnit sourceUnit)
public abstract long toNanos(long duration)
public abstract long toMicros(long duration)
public abstract long toMillis(long duration)
public abstract long toSeconds(long duration)
public abstract long toMinutes(long duration)
public abstract long toHours(long duration)
public abstract long toDays(long duration)
Copyright © 2018. All rights reserved.