Class FamilyWallet
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----FamilyWallet
- public class FamilyWallet
- extends Applet
-
amountC
-
-
amountP
-
-
balance
-
-
string
-
-
FamilyWallet(Family)
- FamilyWallet(Family) is a constructor
-
getMoney(int)
- getMoney(int) is invoked by a consumer subtracting money from the wallet
-
isBusy()
- isBusy() is invoked when testing the semaphor
-
putMoney(int)
- putMoney(int) is invoked by a producer adding money to the wallet
balance
public static int balance
amountP
public int amountP
amountC
public int amountC
string
public String string
FamilyWallet
public FamilyWallet(Family family)
- FamilyWallet(Family) is a constructor
- Parameters:
- family - the referring Family instance
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
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
isBusy
public synchronized boolean isBusy()
- isBusy() is invoked when testing the semaphor
- Returns:
- true if semaphor is busy