Package com.primavera.common.value
Class Percent
java.lang.Object
java.lang.Number
com.primavera.common.value.PrmNumber
com.primavera.common.value.Percent
- All Implemented Interfaces:
Serializable,Comparable<PrmNumber>
This value type is used to define a percent value. One-hundred percent (100%) is represented by
1.0, 25% is represented by 0.25, etc.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
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_PERCENT
0.0% -
MAX_PERCENT
Maximum value -
HUNDRED_PERCENT
100.0% -
MIN_PERCENT
Minimum Value
-
-
Constructor Details
-
Percent
public Percent(double d) Constructs aPercentobject with a given percent value indoubleformat. Note that one-hundred percent (100%) is represented by 1.0, 25% is represented by 0.25, etc.- Parameters:
d- the percent value
-
Percent
Constructs aPercentobject with a given percent value inNumberformat. Note that one-hundred percent (100%) is represented by 1.0, 25% is represented by 0.25, etc.- Parameters:
n- the percent value
-
-
Method Details
-
compareTo
Compares twoPercentobjects.- Specified by:
compareToin interfaceComparable<PrmNumber>- Overrides:
compareToin classPrmNumber- Parameters:
obj- theObjectto be compared.- Returns:
- the value
0if the argument is aPercentnumerically equal to thisPercent; a value less than0if the argument is aPercentnumerically greater than thisPercent, or if the argument is not aPercent; and a value greater than0if the argument is aPercentnumerically less than thisPercent.
-