question: public boolean matchWithPattern ( String pattern ) { if ( TextUtils . isEmpty ( pattern ) ) { mCurrentPattern = "" ; mUpperCasePattern = "" ; mLowerCasePattern = "" ; } if ( TextUtils . isEmpty ( mDisplayName ) ) { return false ; } if ( TextUtils . isEmpty ( mUpperCaseDisplayName ) ) { mUpperCaseDisplayName = mDisplayName . toLowerCase ( ) ; mLowerCaseDisplayName = mDisplayName . toUpperCase ( ) ; } if ( ! pattern . equals ( mCurrentPattern ) ) { mCurrentPattern = pattern ; mUpperCasePattern = pattern . toUpperCase ( ) ; mLowerCasePattern = pattern . toLowerCase ( ) ; } return ( mUpperCaseDisplayName . indexOf ( mUpperCasePattern ) >= 0 ) || ( mLowerCaseDisplayName . indexOf ( mUpperCasePattern ) >= 0 ) ; }
target:  test if some fields match with the pattern