Class semper.payment.Amount
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 Streamable, Cloneable
Representation of an amount of money. Currently, two attributes are supported: a currency, and a numeric value.
Version:
$Revision: 1.9 $ $Date: 1997/01/27 12:15:19 $
Author:
N. Asokan (aso@zurich.ibm.com)

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 myStreamSize()
Implementing the Streamable interface
 o readObject(StreamInputInterface)
Implementing the Streamable interface
 o setCurrency(Currency)
Set the currency.
 o setValue(String)
Set the numeric amount.
 o toString()
redefine toString to suit our needs
 o writeObject(StreamOutputInterface)
Implementing the Streamable interface

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
 o writeObject
  public void writeObject(StreamOutputInterface s) throws StreamIOException
Implementing the Streamable interface
Throws: StreamIOException
as usual
 o readObject
  public void readObject(StreamInputInterface s) throws StreamIOException
Implementing the Streamable interface
Throws: StreamIOException
as usual
 o myStreamSize
  public int myStreamSize() throws StreamIOException
Implementing the Streamable interface

All Packages  Class Hierarchy  This Package  Previous  Next  Index