edu.cuny.cat.core
Class Account

java.lang.Object
  extended by edu.cuny.cat.core.Account
All Implemented Interfaces:
edu.cuny.obj.Resetable

public class Account
extends java.lang.Object
implements edu.cuny.obj.Resetable

A moneytary account that can be owned by a trader or specialist.

Version:
$Revision: 1.14 $
Author:
Jinzhong Niu

Field Summary
static java.lang.String ASSETS
           
protected  double balance
           
static java.lang.String EXPENSE
           
static java.lang.String GOODS
           
static java.lang.String INCOME
           
static java.lang.String INFORMATION_FEE
           
static java.lang.String PROFIT_FEE
           
static java.lang.String REGISTRATION_FEE
           
static java.lang.String SHOUT_FEE
           
static java.lang.String TRANSACTION_FEE
           
 
Constructor Summary
Account()
           
 
Method Summary
 double getBalance()
           
 void payFund(java.lang.String type, java.lang.String receiverId, double amount)
           
 double payFundAvailable(java.lang.String type, java.lang.String receiverId, double amount)
          transfers fund up to the amount available in the account or the requested amount, whichever is smaller.
 void receiveFund(java.lang.String type, java.lang.String payerId, double amount)
           
 void reset()
           
 void setBalance(double balance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSACTION_FEE

public static final java.lang.String TRANSACTION_FEE
See Also:
Constant Field Values

REGISTRATION_FEE

public static final java.lang.String REGISTRATION_FEE
See Also:
Constant Field Values

SHOUT_FEE

public static final java.lang.String SHOUT_FEE
See Also:
Constant Field Values

INFORMATION_FEE

public static final java.lang.String INFORMATION_FEE
See Also:
Constant Field Values

PROFIT_FEE

public static final java.lang.String PROFIT_FEE
See Also:
Constant Field Values

GOODS

public static final java.lang.String GOODS
See Also:
Constant Field Values

ASSETS

public static final java.lang.String ASSETS
See Also:
Constant Field Values

EXPENSE

public static final java.lang.String EXPENSE
See Also:
Constant Field Values

INCOME

public static final java.lang.String INCOME
See Also:
Constant Field Values

balance

protected double balance
Constructor Detail

Account

public Account()
Method Detail

reset

public void reset()
Specified by:
reset in interface edu.cuny.obj.Resetable

receiveFund

public void receiveFund(java.lang.String type,
                        java.lang.String payerId,
                        double amount)

payFundAvailable

public double payFundAvailable(java.lang.String type,
                               java.lang.String receiverId,
                               double amount)
transfers fund up to the amount available in the account or the requested amount, whichever is smaller.

Parameters:
type - describes the type of this transfer
receiverId -
amount - the amount requested
Returns:
the amount actually transferred

payFund

public void payFund(java.lang.String type,
                    java.lang.String receiverId,
                    double amount)

getBalance

public double getBalance()

setBalance

public void setBalance(double balance)