banking
Interface Account

All Known Implementing Classes:
DatabaseAccountImpl, SimpleAccountImpl

public interface Account

A simple banking Account interface.

Version:
1.0 - 13/01/2004
Author:
Sara Bouchenak

Method Summary
 void credit(float amount)
          Adds an amount to the current balance of this account.
 void debit(float amount)
          Deducts an amount from the current balance of this account.
 int getAccountNumber()
          Returns the number of this account.
 float getBalance()
          Returns the current balance of this account.
 void setBalance(float amount)
          Sets the balance of this account.
 

Method Detail

getAccountNumber

public int getAccountNumber()
Returns the number of this account.

Returns:
The account number.

getBalance

public float getBalance()
                 throws AccountException
Returns the current balance of this account.

Returns:
The account balance.
Throws:
AccountException - If a problem occurs during this operation, e.g., a problem to access the underlying database if any.

setBalance

public void setBalance(float amount)
                throws AccountException
Sets the balance of this account.

Parameters:
amount - The balance to be set
Throws:
AccountException - If a problem occurs during this operation, e.g., a problem when updating the underlying database if any.

credit

public void credit(float amount)
            throws AccountException
Adds an amount to the current balance of this account.

Parameters:
amount - The amount to add.
Throws:
AccountException - If a problem occurs during this operation, e.g., a problem when accessing/updating the underlying database if any.

debit

public void debit(float amount)
           throws AccountException
Deducts an amount from the current balance of this account.

Parameters:
amount - The amount to be deducted.
Throws:
AccountException - In case the amount to deduct is greater than the current balance, or if a problem occurs when querying/updating the underlying database if any.


University Grenoble 1 (France) - Department of Computer Science
Master M1 - Adaptable Middleware - AOP / AspectJ.