public enum TTimeUnit extends Enum<TTimeUnit>
Enum Constant and Description |
---|
DAYS |
HOURS |
MICROSECONDS |
MILLISECONDS |
MINUTES |
NANOSECONDS |
SECONDS |
Modifier and Type | Method and Description |
---|---|
long |
convert(long sourceDuration,
TTimeUnit sourceUnit) |
void |
sleep(long timeout) |
void |
timedJoin(Thread thread,
long timeout) |
void |
timedWait(Object obj,
long timeout) |
long |
toDays(long duration) |
long |
toHours(long duration) |
long |
toMicros(long duration) |
long |
toMillis(long duration) |
long |
toMinutes(long duration) |
long |
toNanos(long duration) |
long |
toSeconds(long duration) |
static TTimeUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TTimeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TTimeUnit NANOSECONDS
public static final TTimeUnit MICROSECONDS
public static final TTimeUnit MILLISECONDS
public static final TTimeUnit SECONDS
public static final TTimeUnit MINUTES
public static final TTimeUnit HOURS
public static final TTimeUnit DAYS
public static TTimeUnit[] values()
for (TTimeUnit c : TTimeUnit.values()) System.out.println(c);
public static TTimeUnit 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 long convert(long sourceDuration, TTimeUnit sourceUnit)
public long toNanos(long duration)
public long toMicros(long duration)
public long toMillis(long duration)
public long toSeconds(long duration)
public long toMinutes(long duration)
public long toHours(long duration)
public long toDays(long duration)
public void timedWait(Object obj, long timeout) throws InterruptedException
InterruptedException
public void timedJoin(Thread thread, long timeout) throws InterruptedException
InterruptedException
public void sleep(long timeout) throws InterruptedException
InterruptedException
Copyright © 2019. All rights reserved.