Primavera Integration API 7.0

com.primavera.common.value
Class Percent

java.lang.Object
  extended by java.lang.Number
      extended by com.primavera.common.value.PrmNumber
          extended by com.primavera.common.value.Percent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<PrmNumber>

public class Percent
extends 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:
Serialized Form

Field Summary
static Percent HUNDRED_PERCENT
          100.0%
static Percent MAX_PERCENT
          Maximum value
static Percent ZERO_PERCENT
          0.0%
 
Constructor Summary
Percent(double d)
          Constructs a Percent object with a given percent value in double format.
Percent(java.lang.Number n)
          Constructs a Percent object with a given percent value in Number format.
 
Method Summary
 int compareTo(PrmNumber obj)
          Compares two Percent objects.
 
Methods inherited from class com.primavera.common.value.PrmNumber
byteValue, compareTo, doubleValue, equals, floatValue, hashCode, intValue, longValue, setDoubleValue, shortValue, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO_PERCENT

public static final Percent ZERO_PERCENT
0.0%


MAX_PERCENT

public static final Percent MAX_PERCENT
Maximum value


HUNDRED_PERCENT

public static final Percent HUNDRED_PERCENT
100.0%

Constructor Detail

Percent

public Percent(double d)
Constructs a Percent object with a given percent value in double format. Note that one-hundred percent (100%) is represented by 1.0, 25% is represented by 0.25, etc.

Parameters:
d - the percent value

Percent

public Percent(java.lang.Number n)
Constructs a Percent object with a given percent value in Number format. Note that one-hundred percent (100%) is represented by 1.0, 25% is represented by 0.25, etc.

Parameters:
n - the percent value
Method Detail

compareTo

public int compareTo(PrmNumber obj)
Compares two Percent objects.

Specified by:
compareTo in interface java.lang.Comparable<PrmNumber>
Overrides:
compareTo in class PrmNumber
Parameters:
obj - the Object to be compared.
Returns:
the value 0 if the argument is a Percent numerically equal to this Percent; a value less than 0 if the argument is a Percent numerically greater than this Percent, or if the argument is not a Percent; and a value greater than 0 if the argument is a Percent numerically less than this Percent.

Primavera Integration API 7.0

Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.