Class MamaPrice

  • All Implemented Interfaces:
    java.lang.Comparable

    public class MamaPrice
    extends java.lang.Object
    implements java.lang.Comparable
    • Field Detail

      • EPSILON

        public static final double EPSILON
        MAMA_PRICE_EPSILON a value that is considered equivalent to zero.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MamaPrice

        public MamaPrice()
      • MamaPrice

        public MamaPrice​(double value)
      • MamaPrice

        public MamaPrice​(MamaPrice src)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • compareTo

        public int compareTo​(java.lang.Object obj)
        Specified by:
        compareTo in interface java.lang.Comparable
      • add

        public void add​(double value)
      • subtract

        public void subtract​(MamaPrice value)
      • subtract

        public void subtract​(double value)
      • clear

        public void clear()
      • setValue

        public void setValue​(double value)
      • getValue

        public double getValue()
      • getRoundedValue

        public double getRoundedValue()
        This function obtains the double value of the price rounded to zero precision.
        Returns:
        The rounded value.
        Throws:
        com.wombat.mama - MamaException thrown if the underlying JNI object has been destroyed.
        com.wombat.common.WombatException - for other general MAMA errors.
      • getRoundedValue

        public double getRoundedValue​(MamaPricePrecision precision)
        This function obtains the double value of the price rounded to the supplied precision.
        Returns:
        The rounded value.
        Throws:
        com.wombat.mama - MamaException thrown if the underlying JNI object has been destroyed.
        com.wombat.common.WombatException - for other general MAMA errors.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • negate

        public void negate()
      • isZero

        public boolean isZero()
      • setIsValidPrice

        public void setIsValidPrice​(boolean valid)
      • getIsValidPrice

        public boolean getIsValidPrice()
      • copy

        public void copy​(MamaPrice price)
      • destroy

        public void destroy()