public class TimeValue extends Object implements Comparable<TimeValue>
| 限定符和类型 | 字段和说明 |
|---|---|
static TimeValue |
MINUS_ONE |
static long |
NSEC_PER_MSEC
How many nano-seconds in one milli-second
|
static TimeValue |
ZERO |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(TimeValue timeValue) |
long |
days() |
double |
daysFrac() |
long |
duration() |
boolean |
equals(Object o) |
long |
getDays() |
double |
getDaysFrac() |
long |
getHours() |
double |
getHoursFrac() |
long |
getMicros() |
double |
getMicrosFrac() |
long |
getMillis() |
double |
getMillisFrac() |
long |
getMinutes() |
double |
getMinutesFrac() |
long |
getNanos() |
long |
getSeconds() |
double |
getSecondsFrac() |
String |
getStringRep() |
int |
hashCode() |
long |
hours() |
double |
hoursFrac() |
long |
micros() |
double |
microsFrac() |
long |
millis() |
double |
millisFrac() |
long |
minutes() |
double |
minutesFrac() |
long |
nanos() |
static long |
nsecToMSec(long ns) |
static TimeValue |
parseTimeValue(String sValue) |
static TimeValue |
parseTimeValue(String sValue,
TimeValue defaultValue) |
long |
seconds() |
double |
secondsFrac() |
TimeUnit |
timeUnit() |
String |
toHumanReadableString(int fractionPieces)
|
String |
toString()
|
public static final long NSEC_PER_MSEC
public static final TimeValue MINUS_ONE
public static final TimeValue ZERO
public TimeValue(long millis)
public TimeValue(long duration,
TimeUnit timeUnit)
public long duration()
timeUnit() units this value containspublic TimeUnit timeUnit()
duration()public long nanos()
public long getNanos()
public long micros()
public long getMicros()
public long millis()
public long getMillis()
public long seconds()
public long getSeconds()
public long minutes()
public long getMinutes()
public long hours()
public long getHours()
public long days()
public long getDays()
public double microsFrac()
public double getMicrosFrac()
public double millisFrac()
public double getMillisFrac()
public double secondsFrac()
public double getSecondsFrac()
public double minutesFrac()
public double getMinutesFrac()
public double hoursFrac()
public double getHoursFrac()
public double daysFrac()
public double getDaysFrac()
public String toString()
String representation of the current TimeValue.
Note that this method might produce fractional time values (ex 1.6m) which cannot be
parsed by method like parse(String, String, String).
public String toHumanReadableString(int fractionPieces)
String representation of the current TimeValue.
Note that this method might produce fractional time values (ex 1.6m) which cannot be
parsed by method like parse(String, String, String). The number of
fractional decimals (up to 10 maximum) are truncated to the number of fraction pieces
specified.
Also note that the maximum string value that will be generated is
106751.9d due to the way that values are internally converted
to nanoseconds (106751.9 days is Long.MAX_VALUE nanoseconds)fractionPieces - the number of decimal places to includepublic String getStringRep()
public static long nsecToMSec(long ns)
public int compareTo(TimeValue timeValue)
compareTo 在接口中 Comparable<TimeValue>Copyright © 2021. All rights reserved.