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);
}

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 ) ; }
test if some fields match with the pattern
