
package banking.primitive.core;

import java.io.IOException;
import java.util.List;

public interface AccountServer {

	/**
	  Method:newAccount
	  Inputs: type, name, balance
	  Returns: True/False

	  Description: Creates a new account object in the server. if an account already exists with the given name
	  then a new account is not created and stored. 
	*/
	public boolean	newAccount(String type, String name, float balance) throws IllegalArgumentException;

	/**
	  Method:closeAccount
	  Inputs: name
	  Returns: True/False

	  Description: Closes an account.
	*/
	public boolean	closeAccount(String name);

	/**
	  Method: getAccount
	  Inputs: name
	  Returns: account

	  Description: Returns account based on name.
	*/
	public Account	getAccount(String name);

	/**
	  Method: getAllAccounts
	  Inputs: N/A
	  Returns: List

	  Description: Returns a list of all accounts
	*/
	public List<Account> getAllAccounts();

	/**
	  Method: getActiveAccounts
	  Inputs: N/A
	  Returns: List

	  Description: returns a list of Accounts inside the server that are not CLOSED.
	*/
	public List<Account> getActiveAccounts();

	/**
	  Method: saveAccounts
	  Inputs: N/A
	  Returns: N/A

	  Description: Saves the state of the server.
	*/
	public void	saveAccounts() throws IOException;
}

/*
 * File: AccountServer.java
 * Author: kevingary
 * Date: Unknown
 * 
 * Description: contains AccountServer interface for handling accounts
 */


package banking.primitive.core;

import java.io.IOException;
import java.util.List;

public interface AccountServer {

	/** 
	 *  Create a new account object in the server. if an account already exists with the given name
	 *  then a new account is not created and stored.
	 *  
		@param type must be one of Savings or Checking
		@param name leading or trailing whitespace is removed
		@param balance must be non-negative
		@throws IllegalArgumentException if the account type is invalid or the balance is non-negative.
		@return boolean true if the account was created and stored, false otherwise
	*/
	public boolean	newAccount(String type, String name, float balance) throws IllegalArgumentException;

	/** Close an account 
		@param name leading or trailing whitespace is removed
	 * @return boolean true if there was an account with this name and close was successful
	*/
	public boolean	closeAccount(String name);

	/**
	 * @param name name of the account 
	 * @return Account object or null if not found. 
	 */
	public Account	getAccount(String name);

	/** 
	 * @return a list of all Accounts inside the server 
	 */
	public List<Account> getAllAccounts();

	/** 
	 * @return a list of Accounts inside the server that are not CLOSED
	 */
	public List<Account> getActiveAccounts();

	/** 
	 * Saves the state of the server
	 * @throws IOException if unable to save the state
	 */
	public void	saveAccounts() throws IOException;
}


@@ -1349,1650 +1349,4 @@
 %0A%7D%0D%0A
-%0D%0A/*%0D%0A * File: AccountServer.java%0D%0A * Author: kevingary%0D%0A * Date: Unknown%0D%0A * %0D%0A * Description: contains AccountServer interface for handling accounts%0D%0A */%0D%0A%0D%0A%0D%0Apackage banking.primitive.core;%0D%0A%0D%0Aimport java.io.IOException;%0D%0Aimport java.util.List;%0D%0A%0D%0Apublic interface AccountServer %7B%0D%0A%0D%0A%09/** %0D%0A%09 *  Create a new account object in the server. if an account already exists with the given name%0D%0A%09 *  then a new account is not created and stored.%0D%0A%09 *  %0D%0A%09%09@param type must be one of Savings or Checking%0D%0A%09%09@param name leading or trailing whitespace is removed%0D%0A%09%09@param balance must be non-negative%0D%0A%09%09@throws IllegalArgumentException if the account type is invalid or the balance is non-negative.%0D%0A%09%09@return boolean true if the account was created and stored, false otherwise%0D%0A%09*/%0D%0A%09public boolean%09newAccount(String type, String name, float balance) throws IllegalArgumentException;%0D%0A%0D%0A%09/** Close an account %0D%0A%09%09@param name leading or trailing whitespace is removed%0D%0A%09 * @return boolean true if there was an account with this name and close was successful%0D%0A%09*/%0D%0A%09public boolean%09closeAccount(String name);%0D%0A%0D%0A%09/**%0D%0A%09 * @param name name of the account %0D%0A%09 * @return Account object or null if not found. %0D%0A%09 */%0D%0A%09public Account%09getAccount(String name);%0D%0A%0D%0A%09/** %0D%0A%09 * @return a list of all Accounts inside the server %0D%0A%09 */%0D%0A%09public List%3CAccount%3E getAllAccounts();%0D%0A%0D%0A%09/** %0D%0A%09 * @return a list of Accounts inside the server that are not CLOSED%0D%0A%09 */%0D%0A%09public List%3CAccount%3E getActiveAccounts();%0D%0A%0D%0A%09/** %0D%0A%09 * Saves the state of the server%0D%0A%09 * @throws IOException if unable to save the state%0D%0A%09 */%0D%0A%09public void%09saveAccounts() throws IOException;%0D%0A%7D%0D%0A%0D%0A

Update AccountServer.java