private void scanStart ( ) { if ( isNumber ( mInput ) ) { mState = State . NUMBER ; mOutput . append ( mInput ) ; mType = TokenType . VALUE ; // number } else if ( isFirstLetter ( mInput ) ) { mState = State . TEXT ; // word mOutput . append ( mInput ) ; mType = TokenType . TEXT ; } else if ( isSpecial ( mInput ) ) { mState = State . SPECIAL ; // special character with only one digit mOutput . append ( mInput ) ; mType = retrieveType ( mInput ) ; mFinnished = true ; } else if ( isTwoDigistSpecial ( mInput ) ) { mState = State . SPECIAL2 ; // 2 digit special character mOutput . append ( mInput ) ; mType = retrieveType ( mInput ) ; } else if ( ( mInput == ' ' ) || ( mInput == ' ' ) ) { mState = State . START ; mOutput . append ( mInput ) ; mFinnished = true ; mType = TokenType . SPACE ; } else if ( mInput == ' ' ) { mType = TokenType . END ; // end of query mFinnished = true ; mPos -- ; } else { mState = State . UNKNOWN ; // unknown character mOutput . append ( mInput ) ; mFinnished = true ; } mPos ++ ; }
Scans the first character of a token and decides what type it is .