src/main/java/seedu/address/ui/autocompleter/Autocompleter.java
private void updateStateForCommandsWithPrefixes(String commandBoxText, String arguments) {
        ArrayList<String> missingPrefixes = parser.getMissingPrefixes(arguments);
        if (lastCharIsStartOfPrefix(commandBoxText)) {
            state = AutocompleteState.COMMAND_COMPLETE_PREFIX;
            return;
        }

        if (lastTwoCharactersArePrefix(commandBoxText)) {
            setIndexToOneIfNeeded();
            if (missingPrefixes.size() > possibleAutocompleteResults.size()) {
                possibleAutocompleteResults = missingPrefixes;
            }
            state = AutocompleteState.COMMAND_CYCLE_PREFIX;
            return;
        }

        possibleAutocompleteResults = missingPrefixes;
        state = AutocompleteState.COMMAND_NEXT_PREFIX;

    }
/**
     * Updates the {@code state} of the autocompleter for {@code Command} that requires prefixes
     *
     * @param commandBoxText the current text inside the {@code CommandBox}
     * @param arguments the {@code String} of arguments identified by the parser
     */
Updates the  state of the autocompleter for  Command that requires prefixes
@param commandBoxText the current text inside the  CommandBox
@param arguments the  String of arguments identified by the parser
Updates the state of the autocompleter for Command that requires prefixes @param commandBoxText the current text inside the CommandBox @param arguments the String of arguments identified by the parser
private void updateStateForCommandsWithPrefixes(String commandBoxText, String arguments) {
        ArrayList<String> missingPrefixes = parser.getMissingPrefixes(arguments);
        if (lastCharIsStartOfPrefix(commandBoxText)) {
            state = AutocompleteState.COMMAND_COMPLETE_PREFIX;
            return;
        }
        if (lastTwoCharactersArePrefix(commandBoxText)) {
            setIndexToOneIfNeeded();
            if (missingPrefixes.size() > possibleAutocompleteResults.size()) {
                possibleAutocompleteResults = missingPrefixes;
            }
            state = AutocompleteState.COMMAND_CYCLE_PREFIX;
            return;
        }
        possibleAutocompleteResults = missingPrefixes;
        state = AutocompleteState.COMMAND_NEXT_PREFIX;
    }
private void updateStateForCommandsWithPrefixes ( String commandBoxText , String arguments ) { ArrayList < String > missingPrefixes = parser . getMissingPrefixes ( arguments ) ; if ( lastCharIsStartOfPrefix ( commandBoxText ) ) { state = AutocompleteState . COMMAND_COMPLETE_PREFIX ; return ; } if ( lastTwoCharactersArePrefix ( commandBoxText ) ) { setIndexToOneIfNeeded ( ) ; if ( missingPrefixes . size ( ) > possibleAutocompleteResults . size ( ) ) { possibleAutocompleteResults = missingPrefixes ; } state = AutocompleteState . COMMAND_CYCLE_PREFIX ; return ; } possibleAutocompleteResults = missingPrefixes ; state = AutocompleteState . COMMAND_NEXT_PREFIX ; }
Updates the {@code state} of the autocompleter for {@code Command} that requires prefixes
 @param commandBoxText the current text inside the {@code CommandBox}
 @param arguments the {@code String} of arguments identified by the parser
Updates the { @code state } of the autocompleter for { @code Command } that requires prefixes @param commandBoxText the current text inside the { @code CommandBox } @param arguments the { @code String } of arguments identified by the parser