All Packages Class Hierarchy This Package Previous Next Index
Class semper.payment.Amount
java.lang.Object
|
+----semper.payment.Amount
- public class Amount
- extends Object
- implements Serializable, Cloneable
Representation of an amount of money. Currently, two attributes are
supported: a currency, and a numeric value.
- Version:
- $Revision: 1.11 $ $Date: 1997/10/14 15:24:09 $
- Author:
- N. Asokan ([email protected])
-
Amount()
- Constructor without args
-
Amount(String, Currency)
- Create an amount object
-
clone()
- redefine clone() so that anyone can make clones of us; this is
useful in accessor methods of other classes that have an object
of this class as an attribute.
-
equals(Object)
- redefine equals to suit our needs
-
getCurrency()
- Get the currency.
-
getValue()
- Set the numeric amount.
-
hashCode()
- redefine hashCode to suit our needs
-
setCurrency(Currency)
- Set the currency.
-
setValue(String)
- Set the numeric amount.
-
toString()
- redefine toString to suit our needs
Amount
public Amount()
- Constructor without args
Amount
public Amount(String amount,
Currency currency)
- Create an amount object
- Parameters:
- amount - numeric amount (convert to a suitable type before
doing arithmatic with this amount)
- currency - currency
equals
public boolean equals(Object other)
- redefine equals to suit our needs
- Returns:
- true if the objects are equal; false otherwise
- Overrides:
- equals in class Object
- See Also:
- equals
hashCode
public int hashCode()
- redefine hashCode to suit our needs
- Returns:
- integer hashcode
- Overrides:
- hashCode in class Object
- See Also:
- hashCode
toString
public String toString()
- redefine toString to suit our needs
- Returns:
- a string describing the amount
- Overrides:
- toString in class Object
clone
public synchronized Object clone()
- redefine clone() so that anyone can make clones of us; this is
useful in accessor methods of other classes that have an object
of this class as an attribute.
- Returns:
- cloned object
- Overrides:
- clone in class Object
setValue
public synchronized void setValue(String amount)
- Set the numeric amount.
- Parameters:
- amount - numeric amount
- Returns:
- none
getValue
public String getValue()
- Set the numeric amount.
- Returns:
- numeric value of this amount
getCurrency
public Currency getCurrency()
- Get the currency.
- Returns:
- the currency of this amount
setCurrency
public synchronized void setCurrency(Currency currency)
- Set the currency.
- Parameters:
- currency - the currency of this amount
All Packages Class Hierarchy This Package Previous Next Index