package jutil; import java.util.*; import java.io.*; /** * Extends Console by adding a map for storing command * objects. */ abstract public class CommandConsole extends Console { /** * Stores command objects indexed by name. */ protected Map commands = new HashMap(); /** * A utility for fetching commands. * @param cmmd The name of a command. * @return The associated Command object or null. */ protected Command getCommand(String cmmd) { return (Command)commands.get(cmmd); } /** * Initializes model reference in Command class. */ public CommandConsole(Serializable model) { super(model); } /** * Initializes model to null. */ public CommandConsole() { this(null); } }