All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class benno.account.db.Amount

java.lang.Object
   |
   +----benno.account.db.Amount

public final class Amount
extends Object
implements Serializable
An immutable representation of an amount.

Version:
$Revision: 1.9 $
Author:
Ben Clifford

Constructor Index

 o Amount(long, Currency)
Creates a new amount, in the specified currency, with magnitude of u minor units.

Method Index

 o convertTo(Currency)
Returns a new Amount, representing an estimation of the value of the Amount in the specified Currency.
 o equals(Amount)
 o getCurrency()
Accessor method for currency
 o getUnits()
Accessor method for units
 o negate()
Returns an Amount equal to the negative of this amount
 o toString()
Returns the Amount as a string, formatted according to the specifications in the currency.
 o toStringPlain()
Returns the Amount as a string without the currency symbols.

Constructors

 o Amount
 public Amount(long u,
               Currency c)
Creates a new amount, in the specified currency, with magnitude of u minor units.

Methods

 o toString
 public String toString()
Returns the Amount as a string, formatted according to the specifications in the currency.

Overrides:
toString in class Object
 o toStringPlain
 public String toStringPlain()
Returns the Amount as a string without the currency symbols. This format is suitable for putting in a TextField to edit the magnitude.

 o convertTo
 public Amount convertTo(Currency target)
Returns a new Amount, representing an estimation of the value of the Amount in the specified Currency.

Parameters:
target - The target currency
 o negate
 public Amount negate()
Returns an Amount equal to the negative of this amount

 o getCurrency
 public Currency getCurrency()
Accessor method for currency

 o getUnits
 public long getUnits()
Accessor method for units

 o equals
 public boolean equals(Amount a)

All Packages  Class Hierarchy  This Package  Previous  Next  Index