Classes Files

com::wombat::mama::MamaPrice

Inherits from Comparable

Public Functions

  Name
  MamaPrice()
  MamaPrice(double value)
  MamaPrice(double value, MamaPricePrecision precision)
  MamaPrice(MamaPrice src)
int hashCode()
boolean equals(Object obj)
int compareTo(Object obj)
void add(MamaPrice value)
void add(double value)
void subtract(MamaPrice value)
void subtract(double value)
native void clear()
void set(double priceValue, MamaPriceHints hints)
native void setValue(double value)
native void setFromString(String value)
void setPrecision(MamaPricePrecision precision)
void setHints(MamaPriceHints hints)
native double getValue()
double getRoundedValue()
double getRoundedValue(MamaPricePrecision precision)
MamaPricePrecision getPrecision()
MamaPriceHints getHints()
native String toString()
void negate()
boolean isZero()
native void setIsValidPrice(boolean valid)
native boolean getIsValidPrice()
native void copy(MamaPrice price)
native void destroy()

Protected Functions

  Name
long getPointerVal()
Object clone()
void finalize()

Public Attributes

  Name
final double EPSILON

Public Functions Documentation

function MamaPrice

inline MamaPrice()

function MamaPrice

inline MamaPrice(
    double value
)

function MamaPrice

inline MamaPrice(
    double value,
    MamaPricePrecision precision
)

function MamaPrice

inline MamaPrice(
    MamaPrice src
)

function hashCode

inline int hashCode()

function equals

inline boolean equals(
    Object obj
)

function compareTo

inline int compareTo(
    Object obj
)

function add

inline void add(
    MamaPrice value
)

function add

inline void add(
    double value
)

function subtract

inline void subtract(
    MamaPrice value
)

function subtract

inline void subtract(
    double value
)

function clear

native void clear()

function set

inline void set(
    double priceValue,
    MamaPriceHints hints
)

function setValue

native void setValue(
    double value
)

function setFromString

native void setFromString(
    String value
)

function setPrecision

inline void setPrecision(
    MamaPricePrecision precision
)

function setHints

inline void setHints(
    MamaPriceHints hints
)

function getValue

native double getValue()

function getRoundedValue

inline double getRoundedValue()

Exceptions:

  • com.wombat.mama.MamaException thrown if the underlying JNI object has been destroyed.
  • com.wombat.common.WombatException for other general MAMA errors.

Return: The rounded value.

This function obtains the double value of the price rounded to zero precision.

function getRoundedValue

inline double getRoundedValue(
    MamaPricePrecision precision
)

Parameters:

  • precision The precision to use for rounding.

Exceptions:

  • com.wombat.mama.MamaException thrown if the underlying JNI object has been destroyed.
  • com.wombat.common.WombatException for other general MAMA errors.

Return: The rounded value.

This function obtains the double value of the price rounded to the supplied precision.

function getPrecision

inline MamaPricePrecision getPrecision()

function getHints

inline MamaPriceHints getHints()

function toString

native String toString()

function negate

inline void negate()

function isZero

inline boolean isZero()

function setIsValidPrice

native void setIsValidPrice(
    boolean valid
)

function getIsValidPrice

native boolean getIsValidPrice()

function copy

native void copy(
    MamaPrice price
)

function destroy

native void destroy()

Protected Functions Documentation

function getPointerVal

inline long getPointerVal()

function clone

inline Object clone()

function finalize

inline void finalize()

Public Attributes Documentation

variable EPSILON

static final double EPSILON = 0.00000000001;

MAMA_PRICE_EPSILON a value that is considered equivalent to zero.


Updated on 2023-03-31 at 15:29:43 +0100