com.bea.commerce.ebusiness.price.quote
Class AbstractMoney
java.lang.Object
com.bea.commerce.ebusiness.price.quote.AbstractMoney
- All Implemented Interfaces:
- Money, Serializable
- Direct Known Subclasses:
- ImmutableMoney, MutableMoney
- public abstract class AbstractMoney
- extends Object
- implements Money
- See Also:
- Serialized Form
NO_CURRENCY
public static final String NO_CURRENCY
- See Also:
- Constant Field Values
ZERO
public static final double ZERO
- See Also:
- Constant Field Values
AbstractMoney
public AbstractMoney()
compare
public static int compare(Money moneyA,
Money moneyB)
throws CurrencyMismatchException
- Compares to money objects.
- Parameters:
moneyA
- a Money objectmoneyB
- a Money object
- Returns:
- -1, 0, or 1 corresponding to the contract for
the Comparator interface.
- Throws:
CurrencyMismatchException
- if the currencies
of the two Money objects differ.- See Also:
Money
,
CurrencyMismatchException
equals
public boolean equals(Object object)
- Compares the specified object with this object.
This method will return true if the specified
object implements the Money interface and
has the same currency and amount as this object.
- Parameters:
object
-
- Returns:
- true if the specified object implements
the Money interface and has the same currency as
this object.
- See Also:
Money
getCurrency
public abstract String getCurrency()
- Specified by:
getCurrency
in interface Money
- Returns:
- the currency string.
getValue
public abstract double getValue()
- Specified by:
getValue
in interface Money
- Returns:
- the amount of money
toString
public String toString()
- Returns a string containing the value and currency of
the object.
- Returns:
- the value and currency of the object as a String
Copyright © 2005 BEA Systems, Inc. All Rights Reserved