Dashboard > GreenPepper Demo > ... > Bank > CheckingAccount.java
  GreenPepper Demo Log In View a printable version of the current page.  
  CheckingAccount.java
Added by admin, last edited by admin on Jan 07, 2009
Labels: 
(None)

CheckingAccount.java
package com.greenpepper.confluence.demo.bank;

public class CheckingAccount
    extends BankAccount
{

  private Money maxCredit = Money.ZERO;

  public CheckingAccount(String number, Owner owner)
  {
    super(AccountType.CHECKING, number, owner);
  }

  public void checkFunds(Money amount)
      throws Exception
  {
    if (getBalance().plus(maxCredit).lowerThan(amount))
    {
      throw new Exception("Not enougth credit !");
    }
  }

  public void setCreditLine(Money credit)
  {
    this.maxCredit = credit;
  }

  public Money limitFor(WithdrawType type)
  {
    return AccountType.CHECKING.limitFor(type);
  }
}

DEMONSTRATION LICENSE - This Confluence site is for demonstration purposes only. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.4.3 Build:#705 Mar 21, 2007) - Bug/feature request - Contact Administrators