/** * FinchDataAbstract *
* Your FinchData 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 java.util.Collections; import finch.*; abstract public class FinchDataAbstract { /** * A reference to the Finch object */ protected Finch myFinch; /** * The master action list */ protected FinchActionList actionList; /** * Constructor * *
* @param myFinch A reference to the Finch object *
* Postconditions: *
* @return The master action list. */ public FinchActionList getFinchActionList() { return(actionList); } /** * 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 * @param merge_flag Indicates whether the loaded action list replaces * the master action list or the loaded action list is merged into the * existing action list */ abstract public void loadText(File file, boolean merge_flag); /** * Load an action list from a binary file. *
* *
* Postconditions: *
* * @param file The name of the file to load * @param merge_flag Indicates whether the loaded action list replaces * the master action list or the loaded action list is merged into the * existing action list */ abstract public void loadBinary(File file, boolean merge_flag); /** * 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); /** * Clean the master action list by deleting all duplicate entries. * *
* * Postconditions: *
* Note: equality is defined by the equality of the reference * (hint: review the available ArrayList 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 defined first by name and then by priority. * */ abstract public void execute(String name, boolean reverse); }