public class Duration extends PrmNumber
| Modifier and Type | Field and Description |
|---|---|
static Duration |
MAX_DURATION
Maximum duration value
|
static int |
MINUTES_IN_HOUR
Number of minutes in an hour
|
static Duration |
ONE_DURATION
One duration value
|
static Duration |
ZERO_DURATION
Zero duration value
|
| Constructor and Description |
|---|
Duration(double d)
Constructs a
Duration object with a given duration value in double
format. |
Duration(double d,
boolean flag) |
Duration(Number n)
Constructs a
Duration object with a given duration value in Number
format. |
Duration(Number n,
boolean flag)
Constructs a
Duration object with a given duration value in Number
format. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(PrmNumber obj)
Compares two
Duration objects. |
byteValue, compareTo, doubleValue, equals, floatValue, hashCode, intValue, longValue, setDoubleValue, shortValue, toStringpublic static final Duration ZERO_DURATION
public static final Duration ONE_DURATION
public static final Duration MAX_DURATION
public static final int MINUTES_IN_HOUR
public Duration(double d)
Duration object with a given duration value in double
format.d - the duration valuepublic Duration(double d,
boolean flag)
public Duration(Number n, boolean flag)
Duration object with a given duration value in Number
format.n - the duration valuepublic Duration(Number n)
Duration object with a given duration value in Number
format.n - the duration valuepublic int compareTo(PrmNumber obj)
Duration objects.compareTo in interface Comparable<PrmNumber>compareTo in class PrmNumberobj - the Object to be compared.0 if the argument is a Duration numerically
equal to this Duration; a value less than 0 if the
argument is a Duration numerically greater than this
Duration, or if the argument is not a Duration; and a
value greater than 0 if the argument is a Duration
numerically less than this Duration.Copyright © 2003, 2021, Oracle and/or its affiliates.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.