/*
 * Read Write Lock Pattern .
 *
 * Copyright (C) 2004 Claude Hussenet
 * Contact : chussenet@yahoo.com
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package test.patterns.readwritelock;
/**
 * @version <tt>$Revision: 1.2.4.3 $</tt>
 * @author  <a href="mailto:chussenet@yahoo.com">{Claude Hussenet Independent Consultant}</a>.
 */
public class ProcessTransaction implements Runnable
   {
	   private Account account;
	   private float   amount;

       public ProcessTransaction(Account account,float amount)
       {
	    this.account=account;
	    this.amount=amount;
	   }
	   public void run()
	   {
          if (amount>0) account.credit(amount);
          else account.debit(amount*-1);
	   }
   }

