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
-
Amount(long, Currency)
- Creates a new amount, in the specified currency, with
magnitude of u minor units.
-
convertTo(Currency)
- Returns a new Amount, representing an estimation of the
value of the Amount in the specified Currency.
-
equals(Amount)
-
-
getCurrency()
- Accessor method for currency
-
getUnits()
- Accessor method for units
-
negate()
- Returns an Amount equal to the negative of this amount
-
toString()
- Returns the Amount as a string, formatted according to the
specifications in the currency.
-
toStringPlain()
- Returns the Amount as a string without the currency symbols.
Amount
public Amount(long u,
Currency c)
- Creates a new amount, in the specified currency, with
magnitude of u minor units.
toString
public String toString()
- Returns the Amount as a string, formatted according to the
specifications in the currency.
- Overrides:
- toString in class Object
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.
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
negate
public Amount negate()
- Returns an Amount equal to the negative of this amount
getCurrency
public Currency getCurrency()
- Accessor method for currency
getUnits
public long getUnits()
- Accessor method for units
equals
public boolean equals(Amount a)
All Packages Class Hierarchy This Package Previous Next Index