/** */ private Command getCommandFromString(String commandString) throws UnknownCommandException, InvalidCommandNameException { Command command = null; String key = this.toKey(commandString); if (key != null) { command = this.commandMap.get(key); } if (command == null) { // some commands have a verb longer than 4 letters String verb = this.toVerb(commandString); if (verb != null) { command = this.commandMap.get(verb); } } if (command == null) { throw new UnknownCommandException("Error: command not implemented"); } return command; }
private Command getCommandFromString(String commandString) throws UnknownCommandException, InvalidCommandNameException { Command command = null; String key = toKey(commandString); if (key != null) { command = this.commandMap.get(key); } if (command == null) { // some commands have a verb longer than 4 letters String verb = toVerb(commandString); if (verb != null) { command = this.commandMap.get(verb); } } if (command == null) { throw new UnknownCommandException("Error: command not implemented"); } return command; }
/** */ private Command getCommandFromString(String commandString) throws UnknownCommandException, InvalidCommandNameException { Command command = null; String key = this.toKey(commandString); if (key != null) { command = this.commandMap.get(key); } if (command == null) { // some commands have a verb longer than 4 letters String verb = this.toVerb(commandString); if (verb != null) { command = this.commandMap.get(verb); } } if (command == null) { throw new UnknownCommandException("Error: command not implemented"); } return command; }