Class PrmNumber

java.lang.Object
java.lang.Number
com.primavera.common.value.PrmNumber
All Implemented Interfaces:
Serializable, Comparable<PrmNumber>
Direct Known Subclasses:
Cost, Duration, Percent, Unit, UnitsPerTime

public class PrmNumber extends Number implements Comparable<PrmNumber>
This value type is used to define a Number object. It is a wrapper class of Number.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PrmNumber
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Returns the value of the specified number as a byte.
    int
    compareTo(double value)
    Compare this PrmNumber object to a double.
    int
    Compare two PrmNumber objects.
    double
    Returns the value of the specified number as a double.
    boolean
    Compares this PrmNumber to the specified object.
    float
    Returns the value of the specified number as a float.
    int
    Returns a hash code for this object.
    int
    Returns the value of the specified number as an int.
    long
    Returns the value of the specified number as a long.
    void
    setDoubleValue(double v)
    Set the value of this object with a given value.
    short
    Returns the value of the specified number as a short.
    Returns a string representation of the object.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Method Details

    • toString

      public String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object
    • doubleValue

      public double doubleValue()
      Returns the value of the specified number as a double. This may involve rounding.
      Specified by:
      doubleValue in class Number
      Returns:
      the numeric value represented by this object after conversion to type double.
    • hashCode

      public int hashCode()
      Returns a hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • floatValue

      public float floatValue()
      Returns the value of the specified number as a float. This may involve rounding.
      Specified by:
      floatValue in class Number
      Returns:
      the numeric value represented by this object after conversion to type float.
    • longValue

      public long longValue()
      Returns the value of the specified number as a long. This may involve rounding or truncation.
      Specified by:
      longValue in class Number
      Returns:
      the numeric value represented by this object after conversion to type long.
    • intValue

      public int intValue()
      Returns the value of the specified number as an int. This may involve rounding or truncation.
      Specified by:
      intValue in class Number
      Returns:
      the numeric value represented by this object after conversion to type int.
    • shortValue

      public short shortValue()
      Returns the value of the specified number as a short. This may involve rounding or truncation.
      Overrides:
      shortValue in class Number
      Returns:
      the numeric value represented by this object after conversion to type short.
    • byteValue

      public byte byteValue()
      Returns the value of the specified number as a byte. This may involve rounding or truncation.
      Overrides:
      byteValue in class Number
      Returns:
      the numeric value represented by this object after conversion to type byte.
    • compareTo

      public int compareTo(PrmNumber obj)
      Compare two PrmNumber objects.
      Specified by:
      compareTo in interface Comparable<PrmNumber>
      Parameters:
      obj - the Object to be compared.
      Returns:
      the value 0 if the argument is a PrmNumber numerically equal to this PrmNumber; a value less than 0 if the argument is a PrmNumber numerically greater than this PrmNumber, or if the argument is not a PrmNumber; and a value greater than 0 if the argument is a PrmNumber numerically less than this PrmNumber.
    • compareTo

      public int compareTo(double value)
      Compare this PrmNumber object to a double.
      Parameters:
      value - the double to be compared.
      Returns:
      the value 0 if the argument is numerically equal to the value presented by this PrmNumber; a value less than 0 if the argument is numerically greater than the value presented by this PrmNumber; and a value greater than 0 if the argument is numerically less than the value presented by this PrmNumber.
    • equals

      public boolean equals(Object obj)
      Compares this PrmNumber to the specified object. The result is true if compareTo(obj) is 0
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare this PrmNumber against.
      Returns:
      true if the PrmNumber are equal; false otherwise.
    • setDoubleValue

      public void setDoubleValue(double v)
      Set the value of this object with a given value.
      Parameters:
      v - the value.