src/main/java/seedu/address/logic/parser/AddressBookParser.java
public Command parseCommand(String userInput) throws ParseException {
        final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());
        if (!matcher.matches()) {
            throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE));
        }

        final String commandWord = matcher.group("commandWord");
        final String arguments = matcher.group("arguments");
        switch (commandWord) {

        case ClearCommand.COMMAND_WORD:
            return new ClearCommand();

        case ExitCommand.COMMAND_WORD:
            return new ExitCommand();

        case HelpCommand.COMMAND_WORD:
            return new HelpCommand();

        case EditApplicant.COMMAND_WORD:
            return new EditApplicantParser().parse(arguments);

        case AddApplicant.COMMAND_WORD:
            return new AddApplicantParser().parse(arguments);

        case MarkApplicant.COMMAND_WORD:
            return new MarkApplicantParser().parse(arguments);

        case DeleteApplicant.COMMAND_WORD:
            return new DeleteApplicantParser().parse(arguments);

        case FindApplicant.COMMAND_WORD:
            return new FindApplicantParser().parse(arguments);

        case ListApplicant.COMMAND_WORD:
            return new ListApplicant();

        case SortApplicant.COMMAND_WORD:
            return new SortApplicantParser().parse(arguments);

        case MarkJob.COMMAND_WORD:
            return new MarkJobParser().parse(arguments);

        case AddJob.COMMAND_WORD:
            return new AddJobParser().parse(arguments);

        case EditJob.COMMAND_WORD:
            return new EditJobParser().parse(arguments);

        case ListJob.COMMAND_WORD:
            return new ListJob();

        case TabApplicant.COMMAND_WORD:
            return new TabApplicant();

        case TabJob.COMMAND_WORD:
            return new TabJob();

        case DeleteJob.COMMAND_WORD:
            return new DeleteJobParser().parse(arguments);

        case FindJob.COMMAND_WORD:
            return new FindJobParser().parse(arguments);

        case SortJob.COMMAND_WORD:
            return new SortJob();

        default:
            throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
        }
    }
/**
     * Parses user input into command for execution.
     *
     * @param userInput full user input string
     * @return the command based on the user input
     * @throws ParseException if the user input does not conform the expected format
     */
Parses user input into command for execution.
@param userInput full user input string
@return the command based on the user input
@throws ParseException if the user input does not conform the expected format
Parses user input into command for execution . @param userInput full user input string @return the command based on the user input @throws ParseException if the user input does not conform the expected format
public Command parseCommand(String userInput) throws ParseException {
        final Matcher matcher = BASIC_COMMAND_FORMAT.matcher(userInput.trim());
        if (!matcher.matches()) {
            throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE));
        }
        final String commandWord = matcher.group("commandWord");
        final String arguments = matcher.group("arguments");
        switch (commandWord) {
        case ClearCommand.COMMAND_WORD:
            return new ClearCommand();
        case ExitCommand.COMMAND_WORD:
            return new ExitCommand();
        case HelpCommand.COMMAND_WORD:
            return new HelpCommand();
        case EditApplicant.COMMAND_WORD:
            return new EditApplicantParser().parse(arguments);
        case AddApplicant.COMMAND_WORD:
            return new AddApplicantParser().parse(arguments);
        case MarkApplicant.COMMAND_WORD:
            return new MarkApplicantParser().parse(arguments);
        case DeleteApplicant.COMMAND_WORD:
            return new DeleteApplicantParser().parse(arguments);
        case FindApplicant.COMMAND_WORD:
            return new FindApplicantParser().parse(arguments);
        case ListApplicant.COMMAND_WORD:
            return new ListApplicant();
        case SortApplicant.COMMAND_WORD:
            return new SortApplicantParser().parse(arguments);
        case MarkJob.COMMAND_WORD:
            return new MarkJobParser().parse(arguments);
        case AddJob.COMMAND_WORD:
            return new AddJobParser().parse(arguments);
        case EditJob.COMMAND_WORD:
            return new EditJobParser().parse(arguments);
        case ListJob.COMMAND_WORD:
            return new ListJob();
        case TabApplicant.COMMAND_WORD:
            return new TabApplicant();
        case TabJob.COMMAND_WORD:
            return new TabJob();
        case DeleteJob.COMMAND_WORD:
            return new DeleteJobParser().parse(arguments);
        case FindJob.COMMAND_WORD:
            return new FindJobParser().parse(arguments);
        case SortJob.COMMAND_WORD:
            return new SortJob();
        default:
            throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
        }
    }
public Command parseCommand ( String userInput ) throws ParseException { final Matcher matcher = BASIC_COMMAND_FORMAT . matcher ( userInput . trim ( ) ) ; if ( ! matcher . matches ( ) ) { throw new ParseException ( String . format ( MESSAGE_INVALID_COMMAND_FORMAT , HelpCommand . MESSAGE_USAGE ) ) ; } final String commandWord = matcher . group ( "commandWord" ) ; final String arguments = matcher . group ( "arguments" ) ; switch ( commandWord ) { case ClearCommand . COMMAND_WORD : return new ClearCommand ( ) ; case ExitCommand . COMMAND_WORD : return new ExitCommand ( ) ; case HelpCommand . COMMAND_WORD : return new HelpCommand ( ) ; case EditApplicant . COMMAND_WORD : return new EditApplicantParser ( ) . parse ( arguments ) ; case AddApplicant . COMMAND_WORD : return new AddApplicantParser ( ) . parse ( arguments ) ; case MarkApplicant . COMMAND_WORD : return new MarkApplicantParser ( ) . parse ( arguments ) ; case DeleteApplicant . COMMAND_WORD : return new DeleteApplicantParser ( ) . parse ( arguments ) ; case FindApplicant . COMMAND_WORD : return new FindApplicantParser ( ) . parse ( arguments ) ; case ListApplicant . COMMAND_WORD : return new ListApplicant ( ) ; case SortApplicant . COMMAND_WORD : return new SortApplicantParser ( ) . parse ( arguments ) ; case MarkJob . COMMAND_WORD : return new MarkJobParser ( ) . parse ( arguments ) ; case AddJob . COMMAND_WORD : return new AddJobParser ( ) . parse ( arguments ) ; case EditJob . COMMAND_WORD : return new EditJobParser ( ) . parse ( arguments ) ; case ListJob . COMMAND_WORD : return new ListJob ( ) ; case TabApplicant . COMMAND_WORD : return new TabApplicant ( ) ; case TabJob . COMMAND_WORD : return new TabJob ( ) ; case DeleteJob . COMMAND_WORD : return new DeleteJobParser ( ) . parse ( arguments ) ; case FindJob . COMMAND_WORD : return new FindJobParser ( ) . parse ( arguments ) ; case SortJob . COMMAND_WORD : return new SortJob ( ) ; default : throw new ParseException ( MESSAGE_UNKNOWN_COMMAND ) ; } }
Parses user input into command for execution.
Parses user input into command for execution .