private boolean checkAnswer(String input) {
        StringTokenizer tok = new StringTokenizer(validAnswers, ANSWER_SEPARATOR);

        while (tok.hasMoreTokens()) {
            if (tok.nextElement().toString().trim().equalsIgnoreCase(input.trim())) {
                return true;
            }
        }

        log.info("User input is not valid - must be one of " + validAnswers);

        return false;
    }
private boolean checkAnswer ( String input ) { StringTokenizer tok = new StringTokenizer ( validAnswers , ANSWER_SEPARATOR ) ; while ( tok . hasMoreTokens ( ) ) { if ( tok . nextElement ( ) . toString ( ) . trim ( ) . equalsIgnoreCase ( input . trim ( ) ) ) { return true ; } } log . info ( "User input is not valid - must be one of " + validAnswers ) ; return false ; }
Validate given input according to valid answer tokens.
@param input
@return