Package com.wombat.mama
Class MamaPrice
- java.lang.Object
-
- com.wombat.mama.MamaPrice
-
- All Implemented Interfaces:
java.lang.Comparable
public class MamaPrice extends java.lang.Object implements java.lang.Comparable
-
-
Field Summary
Fields Modifier and Type Field Description static doubleEPSILONMAMA_PRICE_EPSILON a value that is considered equivalent to zero.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double value)voidadd(MamaPrice value)voidclear()intcompareTo(java.lang.Object obj)voidcopy(MamaPrice price)voiddestroy()booleanequals(java.lang.Object obj)MamaPriceHintsgetHints()booleangetIsValidPrice()MamaPricePrecisiongetPrecision()doublegetRoundedValue()This function obtains the double value of the price rounded to zero precision.doublegetRoundedValue(MamaPricePrecision precision)This function obtains the double value of the price rounded to the supplied precision.doublegetValue()inthashCode()booleanisZero()voidnegate()voidset(double priceValue, MamaPriceHints hints)voidsetHints(MamaPriceHints hints)voidsetIsValidPrice(boolean valid)voidsetPrecision(MamaPricePrecision precision)voidsetValue(double value)voidsubtract(double value)voidsubtract(MamaPrice value)java.lang.StringtoString()
-
-
-
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(double value, MamaPricePrecision precision)
-
MamaPrice
public MamaPrice(MamaPrice src)
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object obj)
- Specified by:
compareToin interfacejava.lang.Comparable
-
add
public void add(MamaPrice value)
-
add
public void add(double value)
-
subtract
public void subtract(MamaPrice value)
-
subtract
public void subtract(double value)
-
clear
public void clear()
-
set
public void set(double priceValue, MamaPriceHints hints)
-
setValue
public void setValue(double value)
-
setPrecision
public void setPrecision(MamaPricePrecision precision)
-
setHints
public void setHints(MamaPriceHints hints)
-
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.
-
getPrecision
public MamaPricePrecision getPrecision()
-
getHints
public MamaPriceHints getHints()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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()
-
-