Package com.primavera.common.value
Class Duration
java.lang.Object
java.lang.Number
com.primavera.common.value.PrmNumber
com.primavera.common.value.Duration
- All Implemented Interfaces:
Serializable,Comparable<PrmNumber>
This value type is used to define a duration.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDuration(double d) Constructs aDurationobject with a given duration value indoubleformat.Duration(double d, boolean flag) Constructs aDurationobject with a given duration value inNumberformat.Constructs aDurationobject with a given duration value inNumberformat. -
Method Summary
Methods inherited from class com.primavera.common.value.PrmNumber
byteValue, compareTo, doubleValue, equals, floatValue, hashCode, intValue, longValue, setDoubleValue, shortValue, toString
-
Field Details
-
ZERO_DURATION
Zero duration value -
ONE_DURATION
One duration value -
MAX_DURATION
Maximum duration value -
MINUTES_IN_HOUR
public static final int MINUTES_IN_HOURNumber of minutes in an hour- See Also:
-
-
Constructor Details
-
Duration
public Duration(double d) Constructs aDurationobject with a given duration value indoubleformat.- Parameters:
d- the duration value
-
Duration
public Duration(double d, boolean flag) -
Duration
Constructs aDurationobject with a given duration value inNumberformat.- Parameters:
n- the duration value
-
Duration
Constructs aDurationobject with a given duration value inNumberformat.- Parameters:
n- the duration value
-
-
Method Details
-
compareTo
Compares twoDurationobjects.- Specified by:
compareToin interfaceComparable<PrmNumber>- Overrides:
compareToin classPrmNumber- Parameters:
obj- theObjectto be compared.- Returns:
- the value
0if the argument is aDurationnumerically equal to thisDuration; a value less than0if the argument is aDurationnumerically greater than thisDuration, or if the argument is not aDuration; and a value greater than0if the argument is aDurationnumerically less than thisDuration.
-