All Packages Class Hierarchy This Package Previous Next Index
Class benno.account.Total
java.lang.Object
|
+----benno.account.Total
- public final class Total
- extends Object
The Total class stores a sum of Amounts. It is not possible, in general,
to add two Amounts together as they may be in different currencies.
A Total object represents the result of adding several Amount objects
together, by storing one Amount object for each currency encountered.
- Version:
- $Revision: 1.11.8.1 $
- Author:
- Ben Clifford
-
Total()
-
-
add(Amount)
- accumulates the supplied Amount onto the total
-
add(Total)
- accumulates the supplied total into the total
-
convertTo(Currency)
- returns an Amount representing the value of the Total, converted using the
ExchRate mechanism into the supplied currency.
-
toString()
- returns a String representation of the Total, listing each
currency component separately.
-
toString(Currency)
- returns a String representation of the Total, converted using
the ExchRate mechanism into the supplied currency.
Total
public Total()
add
public void add(Amount op)
- accumulates the supplied Amount onto the total
add
public void add(Total op)
- accumulates the supplied total into the total
toString
public String toString()
- returns a String representation of the Total, listing each
currency component separately.
- Overrides:
- toString in class Object
toString
public String toString(Currency c)
- returns a String representation of the Total, converted using
the ExchRate mechanism into the supplied currency.
- Parameters:
- c - The currency to convert the total to. If null is supplied, then
the standard toString() function is called, with no currency
conversion taking place.
convertTo
public Amount convertTo(Currency c)
- returns an Amount representing the value of the Total, converted using the
ExchRate mechanism into the supplied currency.
- Parameters:
- c - The curreny to convert the total to.
All Packages Class Hierarchy This Package Previous Next Index