private boolean isMatch(SearchQuery query,MailboxMessage message) throws MailboxException {
  final List<SearchQuery.Criterion> criteria=query.getCriterias();
  final Collection<MessageUid> recentMessageUids=query.getRecentMessageUids();
  boolean result=true;
  if (criteria != null) {
    for (    SearchQuery.Criterion criterion : criteria) {
      if (!isMatch(criterion,message,recentMessageUids)) {
        result=false;
        break;
      }
    }
  }
  return result;
}

private boolean isMatch ( SearchQuery query , MailboxMessage message ) throws MailboxException { final List < SearchQuery . Criterion > criteria = query . getCriterias ( ) ; final Collection < MessageUid > recentMessageUids = query . getRecentMessageUids ( ) ; boolean result = true ; if ( criteria != null ) { for ( SearchQuery . Criterion criterion : criteria ) { if ( ! isMatch ( criterion , message , recentMessageUids ) ) { result = false ; break ; } } } return result ; }
does the row match the given criteria ?
