FileDocCategorySizeDatePackage
Account.javaAPI DocJBoss 4.2.11944Fri Jul 13 21:02:22 BST 2007test.patterns.readwritelock

Account

public class Account extends Object
version
$Revision: 57186 $
author
{Claude Hussenet Independent Consultant}.

Fields Summary
private float
balance
Constructors Summary
public Account(float balance)

	this.balance=balance;
   
Methods Summary
public voidcredit(float amount)

	   float currentBalance = balance;
	   process(amount);
       this.balance = currentBalance+amount;
   
public voiddebit(float amount)

	   float currentBalance = balance;
	   process(amount);
       this.balance = currentBalance-amount;
   
public floatgetBalance()

	return balance;
   
public voidprocess(float ll)

	  try {

		  Thread.sleep((long)ll);
	  }
	  catch (Exception e)
	  {
		  System.out.println(e);
	  }
   
public java.lang.StringtoString()

	 return new StringBuffer("Balance: $").append(this.balance).toString();