org.jscience.economics.money
Class Account

java.lang.Object
  extended by org.jscience.economics.money.Account
All Implemented Interfaces:
Property, Identified, Named

public class Account
extends java.lang.Object
implements Property, Named, Identified

A class representing a bank account on which you can store money or properties on some things.


Constructor Summary
Account(Bank bank, java.util.Set owners, Identification identification, java.lang.String name, Amount<Money> amount)
          Creates a new Account object.
Account(Bank bank, java.util.Set owners, Identification identification, java.lang.String name, Amount<Money> amount, java.util.Map shares)
          Creates a new Account object.
 
Method Summary
 void addAmount(Amount<Money> amount)
          DOCUMENT ME!
 void addOwner(Human owner)
          DOCUMENT ME!
 void addShare(Share share, int quantity)
          DOCUMENT ME!
 Bank getBank()
          DOCUMENT ME!
 Currency getCurrency()
          DOCUMENT ME!
 Identification getIdentification()
          DOCUMENT ME!
 java.lang.String getName()
          DOCUMENT ME!
 java.util.Set getOwners()
          DOCUMENT ME!
 java.util.Map getShares()
          DOCUMENT ME!
 Amount<Money> getValue()
          DOCUMENT ME!
 boolean isEmpty()
          DOCUMENT ME!
 void removeOwner(Human owner)
          DOCUMENT ME!
 void removeShare(Share share, int quantity)
          DOCUMENT ME!
 void setOwners(java.util.Set owners)
          DOCUMENT ME!
 void setShares(java.util.Map shares)
          DOCUMENT ME!
 void subtractAmount(Amount<Money> amount)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Account

public Account(Bank bank,
               java.util.Set owners,
               Identification identification,
               java.lang.String name,
               Amount<Money> amount)
Creates a new Account object.

Parameters:
bank - DOCUMENT ME!
owners - DOCUMENT ME!
identification - DOCUMENT ME!
name - DOCUMENT ME!
amount - DOCUMENT ME!

Account

public Account(Bank bank,
               java.util.Set owners,
               Identification identification,
               java.lang.String name,
               Amount<Money> amount,
               java.util.Map shares)
Creates a new Account object.

Parameters:
bank - DOCUMENT ME!
owners - DOCUMENT ME!
identification - DOCUMENT ME!
name - DOCUMENT ME!
amount - DOCUMENT ME!
shares - DOCUMENT ME!
Method Detail

getBank

public final Bank getBank()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getOwners

public final java.util.Set getOwners()
DOCUMENT ME!

Specified by:
getOwners in interface Property
Returns:
DOCUMENT ME!

addOwner

public final void addOwner(Human owner)
DOCUMENT ME!

Parameters:
owner - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

removeOwner

public final void removeOwner(Human owner)
DOCUMENT ME!

Parameters:
owner - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

setOwners

public final void setOwners(java.util.Set owners)
DOCUMENT ME!

Parameters:
owners - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

getIdentification

public final Identification getIdentification()
DOCUMENT ME!

Specified by:
getIdentification in interface Identified
Returns:
DOCUMENT ME!

getName

public final java.lang.String getName()
DOCUMENT ME!

Specified by:
getName in interface Named
Returns:
DOCUMENT ME!

getValue

public final Amount<Money> getValue()
DOCUMENT ME!

Specified by:
getValue in interface Property
Returns:
DOCUMENT ME!

getCurrency

public final Currency getCurrency()
DOCUMENT ME!

Returns:
DOCUMENT ME!

addAmount

public final void addAmount(Amount<Money> amount)
DOCUMENT ME!

Parameters:
amount - DOCUMENT ME!

subtractAmount

public final void subtractAmount(Amount<Money> amount)
DOCUMENT ME!

Parameters:
amount - DOCUMENT ME!

isEmpty

public boolean isEmpty()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getShares

public final java.util.Map getShares()
DOCUMENT ME!

Returns:
DOCUMENT ME!

addShare

public final void addShare(Share share,
                           int quantity)
DOCUMENT ME!

Parameters:
share - DOCUMENT ME!
quantity - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

removeShare

public final void removeShare(Share share,
                              int quantity)
DOCUMENT ME!

Parameters:
share - DOCUMENT ME!
quantity - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

setShares

public final void setShares(java.util.Map shares)
DOCUMENT ME!

Parameters:
shares - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!