Class FamilyWallet

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----java.applet.Applet
                                   |
                                   +----FamilyWallet

public class FamilyWallet
extends Applet

Variable Index

 o amountC
 o amountP
 o balance
 o string

Constructor Index

 o FamilyWallet(Family)
FamilyWallet(Family) is a constructor

Method Index

 o getMoney(int)
getMoney(int) is invoked by a consumer subtracting money from the wallet
 o isBusy()
isBusy() is invoked when testing the semaphor
 o putMoney(int)
putMoney(int) is invoked by a producer adding money to the wallet

Variables

 o balance
  public static int balance
 o amountP
  public int amountP
 o amountC
  public int amountC
 o string
  public String string

Constructors

 o FamilyWallet
  public FamilyWallet(Family family)
FamilyWallet(Family) is a constructor

Parameters:
family - the referring Family instance

Methods

 o putMoney
  public synchronized void putMoney(int amount)
putMoney(int) is invoked by a producer adding money to the wallet

Parameters:
amount - the amount to add to the wallet
 o getMoney
  public synchronized void getMoney(int amount)
getMoney(int) is invoked by a consumer subtracting money from the wallet

Parameters:
amount - the amount to subtract from the wallet
 o isBusy
  public synchronized boolean isBusy()
isBusy() is invoked when testing the semaphor

Returns:
true if semaphor is busy