001 package topdown.service;
002
003 import java.util.List;
004
005 /**
006 * The Bank interface.
007 */
008 public interface Bank {
009
010 /**
011 * Adds a new account.
012 * @param name the account owner's name.
013 * @param initBalance the initial balance for the account.
014 * @return the generated account ID.
015 * @throws topdown.service.AccountException if the initial balance is insufficent (<= 0).
016 */
017 public String addNewAccount(String name,float initBalance) throws AccountException;
018
019 /**
020 * Returns the account that has the given ID.
021 * @param id the account ID.
022 * @return the account.
023 */
024 public Account getAccount(String id);
025
026 /**
027 * Returns a list of all account in the bank.
028 * @return the list of accounts.
029 */
030 public List getAccounts();
031
032 }