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

Constructor Index

 o Total()

Method Index

 o add(Amount)
accumulates the supplied Amount onto the total
 o add(Total)
accumulates the supplied total into the total
 o convertTo(Currency)
returns an Amount representing the value of the Total, converted using the ExchRate mechanism into the supplied currency.
 o toString()
returns a String representation of the Total, listing each currency component separately.
 o toString(Currency)
returns a String representation of the Total, converted using the ExchRate mechanism into the supplied currency.

Constructors

 o Total
 public Total()

Methods

 o add
 public void add(Amount op)
accumulates the supplied Amount onto the total

 o add
 public void add(Total op)
accumulates the supplied total into the total

 o toString
 public String toString()
returns a String representation of the Total, listing each currency component separately.

Overrides:
toString in class Object
 o 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.
 o 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