/** * FinchModelAbstract *
* Your FinchModel class must extends this abstract class. This class stores * the "master action list" that is represented by your program. The class * provides: *
* Notes: *
* * @author Andrew H. Fagg * */ import java.io.*; import finch.*; abstract public class FinchModelAbstract { /** * A reference to the Finch object */ protected Finch myFinch; /** * The master action list */ protected FinchActionList masterActionList; /** * Constructor * *
* @param myFinch A reference to the Finch object *
* Postconditions: *
* @return The master action list. */ public FinchActionList getFinchActionList() { return(masterActionList); } /** * Return the subset of the master action list that matches strg * *
* * @param strg String key * @return An action list that contains only those entries of the * master action list that match the name specified by strg */ abstract public FinchActionList getFinchActionList(String strg); /** * Load a text file containing an action list. *
* *
* Postconditions: *
* * @param file The name of the file to load */ abstract public void loadText(File file); /** * Load an action list from a binary file. *
* *
* Postconditions: *
* * @param file The name of the file to load * @param loadType LOAD_FILE = replace the master list with the one loaded from the file, * UNION_FILE = combine the master list with the one loaded (removing duplicates), * INTERSECT_FILE = combine the master list with the one loaded (keeping only the same items) */ abstract public void loadBinary(File file, LoadType loadType); /** * Write the master action list to a binary file. *
* Postconditions: *
* @param file The name of the file to be written. */ abstract public void saveBinary(File file); /** * Delete the specified FinchAction from the master action list. * *
* Note: equality is defined by the equality of the reference * (hint: review the available LinkedList methods) * * *
* Postconditions: *
* @param action A FinchAction to be deleted */ abstract public void delete(FinchAction action); /** * Add a FinchAction to the master action list * * @param action The FinchAction to be added to the master action list. * *
* Postconditions: *
* Postconditions: *
* @param name The action names to execute. If "all", then * execute all actions. * @param reverse If true, then execute the actions in reverse order. * Note that ordering is specified by FinchAction.compareTo() * @param scale The scale at which to execute the actions. * */ abstract public void execute(String name, boolean reverse, double scale); }