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 double
EPSILON
MAMA_PRICE_EPSILON a value that is considered equivalent to zero.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(double value)
void
add(MamaPrice value)
void
clear()
int
compareTo(java.lang.Object obj)
void
copy(MamaPrice price)
void
destroy()
boolean
equals(java.lang.Object obj)
MamaPriceHints
getHints()
boolean
getIsValidPrice()
MamaPricePrecision
getPrecision()
double
getRoundedValue()
This function obtains the double value of the price rounded to zero precision.double
getRoundedValue(MamaPricePrecision precision)
This function obtains the double value of the price rounded to the supplied precision.double
getValue()
int
hashCode()
boolean
isZero()
void
negate()
void
set(double priceValue, MamaPriceHints hints)
void
setHints(MamaPriceHints hints)
void
setIsValidPrice(boolean valid)
void
setPrecision(MamaPricePrecision precision)
void
setValue(double value)
void
subtract(double value)
void
subtract(MamaPrice value)
java.lang.String
toString()
-
-
-
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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
compareTo
public int compareTo(java.lang.Object obj)
- Specified by:
compareTo
in 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:
toString
in 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()
-
-