public class Duration
extends java.lang.Object
The recognized units of time are the "millisecond", "second", "minute" "hour" and "day". The unit name may be followed by an "s". Thus, "2 day" and "2 days" are equivalent. In the absence of a time unit specification, milliseconds are assumed.
Note: the conversion magic is entirely due to the fact that this class follows the
valueOf(java.lang.String)
convention.
Constructor and Description |
---|
Duration(long millis) |
Modifier and Type | Method and Description |
---|---|
static Duration |
buildByDays(double value) |
static Duration |
buildByHours(double value) |
static Duration |
buildByMilliseconds(double value) |
static Duration |
buildByMinutes(double value) |
static Duration |
buildBySeconds(double value) |
static Duration |
buildUnbounded() |
long |
getMilliseconds() |
java.lang.String |
toString() |
static Duration |
valueOf(java.lang.String durationStr) |
public static Duration buildByMilliseconds(double value)
public static Duration buildBySeconds(double value)
public static Duration buildByMinutes(double value)
public static Duration buildByHours(double value)
public static Duration buildByDays(double value)
public static Duration buildUnbounded()
public long getMilliseconds()
public static Duration valueOf(java.lang.String durationStr)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved