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])

Constructor Index

 o Amount()
Constructor without args
 o Amount(String, Currency)
Create an amount object

Method Index

 o 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.
 o equals(Object)
redefine equals to suit our needs
 o getCurrency()
Get the currency.
 o getValue()
Set the numeric amount.
 o hashCode()
redefine hashCode to suit our needs
 o setCurrency(Currency)
Set the currency.
 o setValue(String)
Set the numeric amount.
 o toString()
redefine toString to suit our needs

Constructors

 o Amount
 public Amount()
Constructor without args

 o 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

Methods

 o 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
 o hashCode
 public int hashCode()
redefine hashCode to suit our needs

Returns:
integer hashcode
Overrides:
hashCode in class Object
See Also:
hashCode
 o toString
 public String toString()
redefine toString to suit our needs

Returns:
a string describing the amount
Overrides:
toString in class Object
 o 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
 o setValue
 public synchronized void setValue(String amount)
Set the numeric amount.

Parameters:
amount - numeric amount
Returns:
none
 o getValue
 public String getValue()
Set the numeric amount.

Returns:
numeric value of this amount
 o getCurrency
 public Currency getCurrency()
Get the currency.

Returns:
the currency of this amount
 o 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