@@ -0,0 +1,1825 @@
+import java.util.*;%0Apublic class CommandProcessor%0A%7B%0A%09/*%0A%09%09Courtney Karppi%0A%09%09CISC 370%0A%09%09April 18, 2015%0A%09*/%0A%09private static %09Map%3CString,Command%3EcommandRegistry;%0A%09private Command noSuchCommand;%0A%09private Command nothingEnteredCommand;%0A%0A%09public CommandProcessor(Command noSuchCommand, Command nothingEnteredCommand)%0A%09%7B%0A%09%09this.noSuchCommand = noSuchCommand;%0A%09%09this.nothingEnteredCommand = nothingEnteredCommand;%0A%09%7D//CommandProcessor%0A%0A%09//getAllCommands method returns all the commands in the commandRegistry%0A%09public Command%5B%5D getAllCommands()%0A%09%7B%0A%09%09//returns all the commands in the form of a Command%5B%5D%0A%09%09return commandRegistry.values().toArray(new Command%5B0%5D);%0A%09%7D//getAllCommands%0A%0A%09//registers a new command in the commandRegistry%0A%09public void register(Command command)%0A%09%7B%0A%09%09String commandText;%0A%09%09commandText = convertToKey(command.getCommandName());%0A%0A%09%09//checks the parameter to make sure it is not blank or not in the commandRegistry%0A%09%09if(!(commandText.equals(%22%22)%7C%7CcommandRegistry.containsKey(commandText)))%0A%09%09%7B%0A%09%09%09commandRegistry.put(commandText, command);%0A%09%09%7D%0A%09%7D//register%0A%0A%09//runs the command associated with the parameter%0A%09public void runCommand(String commandText)%0A%09%7B%0A%09%09Command command;%0A%0A%09%09//checks to see if the paramter is not blank or already in the commandRegistry%0A%09%09//if its not then it executes the associated command%0A%09%09if(!convertToKey(commandText).equals(%22%22))%0A%09%09%7B%0A%09%09%09command = this.nothingEnteredCommand;%0A%09%09%7D%0A%09%09else if (!commandRegistry.containsKey(convertToKey(commandText)))%0A%09%09%7B%0A%09%09%09command = this.noSuchCommand;%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09command = commandRegistry.get(convertToKey(commandText));%0A%09%09%7D%0A%09%09command.execute();%0A%09%7D//runCommand%0A%0A%09//Removes the white space from the data and converts it to lower case%0A%09private static String convertToKey(String data)%0A%09%7B%0A%09%09return data.trim().toLowerCase();%0A%09%7D//convertToKey%0A%0A%7D//class%0A

Create CommandProcessor.java