import java.util.*;

// TODO Test
public class CommandProcessor
{
	/*
		Courtney Karppi
		CISC 370
		April 18, 2015
	*/
	private Map<String,Command>commandRegistry;
	private Command noSuchCommand;
	private Command nothingEnteredCommand;

	public CommandProcessor(Command noSuchCommand, Command nothingEnteredCommand)
	{
		this.noSuchCommand = noSuchCommand;
		this.nothingEnteredCommand = nothingEnteredCommand;
		this.commandRegistry = new HashMap<String, Command>();
		
		// TODO ask Jarvis what do we do with the noSuch and nothingEntered commands
	}//CommandProcessor

	//getAllCommands method returns all the commands in the commandRegistry
	public Command[] getAllCommands()
	{
		//returns all the commands in the form of a Command[]
		return commandRegistry.values().toArray(new Command[0]);
	}//getAllCommands

	//registers a new command in the commandRegistry
	public void register(Command command)
	{
		String commandText;
		commandText = convertToKey(command.getCommandName());

		//checks the parameter to make sure it is not blank or not in the commandRegistry
		if(!(commandText.equals("")||commandRegistry.containsKey(commandText)))
		{
			commandRegistry.put(commandText, command);
		}
	}//register

	//runs the command associated with the parameter
	public Command getCommand(String commandText)
	{
		return commandRegistry.get(convertToKey(commandText));
	}//getCommand

	//Removes the white space from the data and converts it to lower case
	private static String convertToKey(String data)
	{
		return data.trim().toLowerCase();
	}//convertToKey

}//class

@@ -18,21 +18,8 @@
 *;%0A%0A
-// TODO Test%0A
 publ
@@ -96,16 +96,17 @@
 8, 2015%0A
+%0A
 %09*/%0A%09pri
@@ -454,90 +454,9 @@
 ();%0A
-%09%09%0A%09%09// TODO ask Jarvis what do we do with the noSuch and nothingEntered commands
 %0A
+
 %09%7D//
@@ -1222,62 +1222,264 @@
 %7B%0A%09%09
-return commandRegistry.get(convertToKey(commandText));
+Command command;%0A%09%09if(commandText.length() == 0)%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%09if (command == null)%0A%09%09%7B%0A%09%09%09command = this.nothingEnteredCommand;%0A%09%09%7D%0A%09%09return command;%0A
 %0A%09%7D/
@@ -1668,16 +1668,16 @@
 tToKey%0A%0A
-
 %7D//class
@@ -1677,8 +1677,9 @@
 //class%0A
+%0A

Update CommandProcessor.java