james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r635199 - in /james/server/trunk/torque-mailboxmanager-function/src: main/java/org/apache/james/mailboxmanager/torque/ test/java/org/apache/james/mailboxmanager/torque/
Date Sun, 09 Mar 2008 08:55:08 GMT
Author: rdonkin
Date: Sun Mar  9 00:55:07 2008
New Revision: 635199

URL: http://svn.apache.org/viewvc?rev=635199&view=rev
Log:
Wired up searches

Modified:
    james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/SearchUtils.java
    james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
    james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsMultipartMixedTest.java
    james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsRFC822Test.java
    james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsTest.java

Modified: james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/SearchUtils.java
URL: http://svn.apache.org/viewvc/james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/SearchUtils.java?rev=635199&r1=635198&r2=635199&view=diff
==============================================================================
--- james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/SearchUtils.java (original)
+++ james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/SearchUtils.java Sun Mar  9 00:55:07 2008
@@ -47,7 +47,38 @@
  */
 class SearchUtils {
     
-    public static boolean matches(SearchQuery.Criterion criterion, MessageRow row) throws TorqueException {
+    /**
+     * Does the row match the given criteria?
+     * @param query <code>SearchQuery</code>, not null
+     * @param row <code>MessageRow</code>, not null
+     * @return true if the row matches the given criteria,
+     * false otherwise
+     * @throws TorqueException
+     */
+    public static boolean isMatch(final SearchQuery query, final MessageRow row) throws TorqueException {
+        final List criteria = query.getCriterias();
+        boolean result = true;
+        if (criteria != null) {
+            for (Iterator it = criteria.iterator(); it.hasNext();) {
+                final SearchQuery.Criterion criterion = (SearchQuery.Criterion) it.next();
+                if (!isMatch(criterion, row)) {
+                    result = false;
+                    break;
+                }
+            }
+        }
+        return result;
+    }
+    
+    /**
+     * Does the row match the given criterion?
+     * @param query <code>SearchQuery.Criterion</code>, not null
+     * @param row <code>MessageRow</code>, not null
+     * @return true if the row matches the given criterion,
+     * false otherwise
+     * @throws TorqueException
+     */
+    public static boolean isMatch(SearchQuery.Criterion criterion, MessageRow row) throws TorqueException {
         final boolean result;
         if (criterion instanceof SearchQuery.InternalDateCriterion) {
             result = matches((SearchQuery.InternalDateCriterion) criterion, row);
@@ -118,7 +149,7 @@
         boolean result = true;
         for (Iterator it = criteria.iterator(); it.hasNext();) {
             final SearchQuery.Criterion criterion = (SearchQuery.Criterion) it.next();
-            final boolean matches = matches(criterion, row);
+            final boolean matches = isMatch(criterion, row);
             if (!matches) {
                 result = false;
                 break;
@@ -131,7 +162,7 @@
         boolean result = false;
         for (Iterator it = criteria.iterator(); it.hasNext();) {
             final SearchQuery.Criterion criterion = (SearchQuery.Criterion) it.next();
-            final boolean matches = matches(criterion, row);
+            final boolean matches = isMatch(criterion, row);
             if (matches) {
                 result = true;
                 break;
@@ -144,7 +175,7 @@
         boolean result = true;
         for (Iterator it = criteria.iterator(); it.hasNext();) {
             final SearchQuery.Criterion criterion = (SearchQuery.Criterion) it.next();
-            final boolean matches = matches(criterion, row);
+            final boolean matches = isMatch(criterion, row);
             if (matches) {
                 result = false;
                 break;

Modified: james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
URL: http://svn.apache.org/viewvc/james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java?rev=635199&r1=635198&r2=635199&view=diff
==============================================================================
--- james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java (original)
+++ james/server/trunk/torque-mailboxmanager-function/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java Sun Mar  9 00:55:07 2008
@@ -23,6 +23,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.sql.SQLException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
@@ -286,9 +287,14 @@
 
     private TorqueResultIterator getMessages(FetchGroup result, UidRange range, Criteria c) throws TorqueException, MessagingException, MailboxManagerException {
         List rows = MessageRowPeer.doSelectJoinMessageFlags(c);
+        final TorqueResultIterator results = getResults(result, rows);
+        getUidChangeTracker().found(range, results.getMessageFlags());
+        return results;
+    }
+
+    private TorqueResultIterator getResults(FetchGroup result, List rows) throws TorqueException {
         Collections.sort(rows, MessageRowUtils.getUidComparator());
         final TorqueResultIterator results = new TorqueResultIterator(rows, result, getUidToKeyConverter());
-        getUidChangeTracker().found(range, results.getMessageFlags());
         return results;
     }
 
@@ -605,17 +611,28 @@
         this.mailboxRow = mailboxRow;
     }
 
-    public Iterator search(SearchQuery parameters, FetchGroup fetchGroup,
+    public Iterator search(SearchQuery query, FetchGroup fetchGroup,
             MailboxSession mailboxSession) throws MailboxManagerException {
         try {
             lock.readLock().acquire();
             try {
                 checkAccess();
                 
-                TorqueCriteriaBuilder builder = new TorqueCriteriaBuilder();
+                final List rows = MessageRowPeer.doSelectJoinMessageFlags(new Criteria());
+                final List filteredMessages = new ArrayList();
+                for (Iterator it = filteredMessages.iterator(); it
+                        .hasNext();) {
+                    final MessageRow row = (MessageRow) it.next();
+                    try {
+                        if (SearchUtils.isMatch(query, row)) {
+                            rows.add(row);
+                        }
+                    } catch (TorqueException e) {
+                        getLog().info("Cannot test message against search criteria. Will continue to test other messages.", e);
+                    }
+                }
                 
-                final Iterator results = getMessages(fetchGroup, new UidRange(1, -1), builder.getCriteria());
-                return results;
+                return getResults(fetchGroup, filteredMessages);
             } catch (TorqueException e) {
                 throw new MailboxManagerException(e);
             } catch (MessagingException e) {

Modified: james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsMultipartMixedTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsMultipartMixedTest.java?rev=635199&r1=635198&r2=635199&view=diff
==============================================================================
--- james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsMultipartMixedTest.java (original)
+++ james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsMultipartMixedTest.java Sun Mar  9 00:55:07 2008
@@ -123,54 +123,54 @@
     }
     
     public void testShouldNotFindWhatIsNotThere() throws Exception {
-        assertFalse(SearchUtils.matches(SearchQuery.bodyContains("BOGUS"), row));
-        assertFalse(SearchUtils.matches(SearchQuery.mailContains("BOGUS"), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.bodyContains("BOGUS"), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.mailContains("BOGUS"), row));
     }
     
     public void testBodyShouldFindTextInBody() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_TWO), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO), row));
     }
     
     public void testBodyShouldFindTextInBodyCaseInsensitive() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_TWO), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_ONE.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_TWO.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE.toUpperCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_ONE.toUpperCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_TWO.toUpperCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_BODY_ONE.toUpperCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_ONE.toUpperCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO.toUpperCase()), row));
     }
     
     public void testBodyShouldNotFindTextInHeaders() throws Exception {
-        assertFalse(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_FIELD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.bodyContains(SAMPLE_PART_TWO_FIELD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_INNER_MAIL_FIELD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.bodyContains(SAMPLE_PART_TWO_FIELD), row));
     }
     
     public void testTextShouldFindTextInBody() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_TWO), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO), row));
     }
     
     public void testTextShouldFindTextInBodyCaseInsensitive() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_TWO), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_ONE.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_TWO.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE.toUpperCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_ONE.toUpperCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_TWO.toUpperCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE.toUpperCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_ONE.toUpperCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO.toUpperCase()), row));
     }
     
     public void testTextShouldFindTextInHeaders() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_INNER_MAIL_FIELD), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SAMPLE_PART_TWO_FIELD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_INNER_MAIL_FIELD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_INNER_MAIL_BODY_ONE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SAMPLE_PART_TWO_FIELD), row));
     }
 }

Modified: james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsRFC822Test.java
URL: http://svn.apache.org/viewvc/james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsRFC822Test.java?rev=635199&r1=635198&r2=635199&view=diff
==============================================================================
--- james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsRFC822Test.java (original)
+++ james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsRFC822Test.java Sun Mar  9 00:55:07 2008
@@ -57,34 +57,34 @@
     }
     
     public void testBodyShouldMatchPhraseInBody() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(CUSTARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.bodyContains(CUSTARD + CUSTARD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(CUSTARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.bodyContains(CUSTARD + CUSTARD), row));
     }
     
     public void testBodyMatchShouldBeCaseInsensitive() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(RHUBARD), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(RHUBARD.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.bodyContains(RHUBARD.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(RHUBARD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(RHUBARD.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.bodyContains(RHUBARD.toLowerCase()), row));
     }
     
     public void testBodyShouldNotMatchPhraseOnlyInHeader() throws Exception {
-        assertFalse(SearchUtils.matches(SearchQuery.bodyContains(FROM_ADDRESS), row));
-        assertFalse(SearchUtils.matches(SearchQuery.bodyContains(SUBJECT_PART), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.bodyContains(FROM_ADDRESS), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.bodyContains(SUBJECT_PART), row));
     }
     
     public void testTextShouldMatchPhraseInBody() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(CUSTARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.mailContains(CUSTARD + CUSTARD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(CUSTARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.mailContains(CUSTARD + CUSTARD), row));
     }
     
     public void testTextMatchShouldBeCaseInsensitive() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(RHUBARD), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(RHUBARD.toLowerCase()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(RHUBARD.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(RHUBARD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(RHUBARD.toLowerCase()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(RHUBARD.toLowerCase()), row));
     }
     
     public void testBodyShouldMatchPhraseOnlyInHeader() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(FROM_ADDRESS), row));
-        assertTrue(SearchUtils.matches(SearchQuery.mailContains(SUBJECT_PART), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(FROM_ADDRESS), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.mailContains(SUBJECT_PART), row));
     }
 }

Modified: james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsTest.java?rev=635199&r1=635198&r2=635199&view=diff
==============================================================================
--- james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsTest.java (original)
+++ james/server/trunk/torque-mailboxmanager-function/src/test/java/org/apache/james/mailboxmanager/torque/SearchUtilsTest.java Sun Mar  9 00:55:07 2008
@@ -56,367 +56,367 @@
     
     public void testMatchSizeLessThan() throws Exception {
         row.setSize(SIZE);
-        assertFalse(SearchUtils.matches(SearchQuery.sizeLessThan(SIZE - 1), row));
-        assertFalse(SearchUtils.matches(SearchQuery.sizeLessThan(SIZE), row));
-        assertTrue(SearchUtils.matches(SearchQuery.sizeLessThan(SIZE + 1), row));
-        assertTrue(SearchUtils.matches(SearchQuery.sizeLessThan(Integer.MAX_VALUE), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeLessThan(SIZE - 1), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeLessThan(SIZE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.sizeLessThan(SIZE + 1), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.sizeLessThan(Integer.MAX_VALUE), row));
     }
     
     public void testMatchSizeMoreThan() throws Exception {
         row.setSize(SIZE);
-        assertTrue(SearchUtils.matches(SearchQuery.sizeGreaterThan(SIZE - 1), row));
-        assertFalse(SearchUtils.matches(SearchQuery.sizeGreaterThan(SIZE), row));
-        assertFalse(SearchUtils.matches(SearchQuery.sizeGreaterThan(SIZE + 1), row));
-        assertFalse(SearchUtils.matches(SearchQuery.sizeGreaterThan(Integer.MAX_VALUE), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.sizeGreaterThan(SIZE - 1), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeGreaterThan(SIZE), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeGreaterThan(SIZE + 1), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeGreaterThan(Integer.MAX_VALUE), row));
     }
     
     public void testMatchSizeEquals() throws Exception {
         row.setSize(SIZE);
-        assertFalse(SearchUtils.matches(SearchQuery.sizeEquals(SIZE - 1), row));
-        assertTrue(SearchUtils.matches(SearchQuery.sizeEquals(SIZE), row));
-        assertFalse(SearchUtils.matches(SearchQuery.sizeEquals(SIZE + 1), row));
-        assertFalse(SearchUtils.matches(SearchQuery.sizeEquals(Integer.MAX_VALUE), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeEquals(SIZE - 1), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.sizeEquals(SIZE), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeEquals(SIZE + 1), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.sizeEquals(Integer.MAX_VALUE), row));
     }
     
     public void testMatchInternalDateEquals() throws Exception {
         row.setInternalDate(SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateOn(9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateOn(8, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.internalDateOn(9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateOn(10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateOn(9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateOn(9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateOn(8, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.internalDateOn(9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateOn(10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateOn(9, 9, 2002), row));
     }
     
     public void testMatchInternalDateBefore() throws Exception {
         row.setInternalDate(SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateBefore(9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateBefore(8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateBefore(9, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.internalDateBefore(10, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.internalDateBefore(9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateBefore(9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateBefore(8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateBefore(9, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.internalDateBefore(10, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.internalDateBefore(9, 9, 2002), row));
     }
         
     public void testMatchInternalDateAfter() throws Exception {
         row.setInternalDate(SUN_SEP_9TH_2001);
-        assertTrue(SearchUtils.matches(SearchQuery.internalDateAfter(9, 9, 2000), row));
-        assertTrue(SearchUtils.matches(SearchQuery.internalDateAfter(8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateAfter(9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateAfter(10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.internalDateAfter(9, 9, 2002), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.internalDateAfter(9, 9, 2000), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.internalDateAfter(8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateAfter(9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateAfter(10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.internalDateAfter(9, 9, 2002), row));
     }
     
     public void testMatchHeaderDateAfter() throws Exception {
         addHeader(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD, 9, 9, 2000), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter("BOGUS",9, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD, 9, 9, 2000), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter("BOGUS",9, 9, 2001), row));
     }
     
     public void testShouldMatchCapsHeaderDateAfter() throws Exception {
         addHeader(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD, 9, 9, 2000), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter("BOGUS",9, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD, 9, 9, 2000), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter("BOGUS",9, 9, 2001), row));
     }
     
     public void testShouldMatchLowersHeaderDateAfter() throws Exception {
         addHeader(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD, 9, 9, 2000), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateAfter("BOGUS",9, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD, 9, 9, 2000), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateAfter("BOGUS",9, 9, 2001), row));
     }
     
     public void testMatchHeaderDateOn() throws Exception {
         addHeader(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD, 9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,8, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn("BOGUS",9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD, 9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,8, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn("BOGUS",9, 9, 2001), row));
     }
     
     public void testShouldMatchCapsHeaderDateOn() throws Exception {
         addHeader(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD, 9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,8, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn("BOGUS",9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD, 9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,8, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn("BOGUS",9, 9, 2001), row));
      }
     
     public void testShouldMatchLowersHeaderDateOn() throws Exception {
         addHeader(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD, 9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,8, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,10, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateOn("BOGUS",9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD, 9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,8, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,10, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateOn("BOGUS",9, 9, 2001), row));
     }
     
     
     public void testMatchHeaderDateBefore() throws Exception {
         addHeader(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD, 9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,10, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore("BOGUS",9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD, 9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,10, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore("BOGUS",9, 9, 2001), row));
     }
     
     public void testShouldMatchCapsHeaderDateBefore() throws Exception {
         addHeader(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD, 9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,10, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore("BOGUS",9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD, 9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,10, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore("BOGUS",9, 9, 2001), row));
     }
     
     public void testShouldMatchLowersHeaderDateBefore() throws Exception {
         addHeader(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD, 9, 9, 2000), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,8, 9, 2001), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,10, 9, 2001), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2002), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerDateBefore("BOGUS",9, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD, 9, 9, 2000), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,8, 9, 2001), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,10, 9, 2001), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerDateBefore(DATE_FIELD,9, 9, 2002), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerDateBefore("BOGUS",9, 9, 2001), row));
     }
     
     public void testMatchHeaderContainsCaps() throws Exception {
         addHeader(SUBJECT_FIELD, TEXT.toUpperCase());
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
     }
     
     public void testMatchHeaderContainsLowers() throws Exception {
         addHeader(SUBJECT_FIELD, TEXT.toLowerCase());
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
     }
     
     public void testMatchHeaderContains() throws Exception {
         addHeader(SUBJECT_FIELD, TEXT);
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
     }
     
     public void testShouldMatchLowerHeaderContains() throws Exception {
         addHeader(SUBJECT_FIELD.toLowerCase(), TEXT);
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
     }
     
     public void testShouldMatchCapsHeaderContains() throws Exception {
         addHeader(SUBJECT_FIELD.toUpperCase(), TEXT);
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
-        assertFalse(SearchUtils.matches(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, CUSTARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(DATE_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, TEXT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, RHUBARD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerContains(SUBJECT_FIELD, CUSTARD), row)); 
     }
     
     public void testMatchHeaderExists() throws Exception {
         addHeader(SUBJECT_FIELD, TEXT);
-        assertFalse(SearchUtils.matches(SearchQuery.headerExists(DATE_FIELD), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerExists(SUBJECT_FIELD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerExists(DATE_FIELD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerExists(SUBJECT_FIELD), row));
     }
 
     public void testShouldMatchLowersHeaderExists() throws Exception {
         addHeader(SUBJECT_FIELD.toLowerCase(), TEXT);
-        assertFalse(SearchUtils.matches(SearchQuery.headerExists(DATE_FIELD), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerExists(SUBJECT_FIELD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerExists(DATE_FIELD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerExists(SUBJECT_FIELD), row));
     }
     
     public void testShouldMatchUppersHeaderExists() throws Exception {
         addHeader(SUBJECT_FIELD.toUpperCase(), TEXT);
-        assertFalse(SearchUtils.matches(SearchQuery.headerExists(DATE_FIELD), row));
-        assertTrue(SearchUtils.matches(SearchQuery.headerExists(SUBJECT_FIELD), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.headerExists(DATE_FIELD), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.headerExists(SUBJECT_FIELD), row));
     }
     
     public void testShouldMatchUidRange() throws Exception {
         row.setPrimaryKey(1, 1729);
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1, 1)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1728, 1728)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.uid(range(1729, 1729)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1730, 1730)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1, 1728)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.uid(range(1, 1729)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.uid(range(1729, 1800)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1730, Long.MAX_VALUE)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1730, Long.MAX_VALUE, 1, 1728)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.uid(range(1730, Long.MAX_VALUE, 1, 1729)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1, 1728, 1800, 1810)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.uid(range(1, 1, 1729, 1729)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.uid(range(1, 1, 1800, 1800)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1, 1)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1728, 1728)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.uid(range(1729, 1729)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1730, 1730)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1, 1728)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.uid(range(1, 1729)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.uid(range(1729, 1800)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1730, Long.MAX_VALUE)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1730, Long.MAX_VALUE, 1, 1728)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.uid(range(1730, Long.MAX_VALUE, 1, 1729)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1, 1728, 1800, 1810)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.uid(range(1, 1, 1729, 1729)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.uid(range(1, 1, 1800, 1800)), row));
     }
     
     public void testShouldMatchSeenFlagSet() throws Exception {
         setFlags(true, false, false, false, false, false);
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchAnsweredFlagSet() throws Exception {
         setFlags(false, false, true, false, false, false);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchFlaggedFlagSet() throws Exception {
         setFlags(false, true, false, false, false, false);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchDraftFlagSet() throws Exception {
         setFlags(false, false, false, true, false, false);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchDeletedFlagSet() throws Exception {
         setFlags(false, false, false, false, true, false);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchSeenRecentSet() throws Exception {
         setFlags(false, false, false, false, false, true);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.DELETED), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsSet(Flags.Flag.RECENT), row));
     }
 
     public void testShouldMatchSeenFlagUnSet() throws Exception {
         setFlags(false, true, true, true, true, true);
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchAnsweredFlagUnSet() throws Exception {
         setFlags(true, true, false, true, true, true);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchFlaggedFlagUnSet() throws Exception {
         setFlags(true, false, true, true, true, true);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchDraftFlagUnSet() throws Exception {
         setFlags(true, true, true, false, true, true);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchDeletedFlagUnSet() throws Exception {
         setFlags(true, true, true, true, false, true);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchSeenRecentUnSet() throws Exception {
         setFlags(true, true, true, true, true, false);
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
-        assertFalse(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
-        assertTrue(SearchUtils.matches(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.FLAGGED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.ANSWERED), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DRAFT), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.DELETED), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.flagIsUnSet(Flags.Flag.RECENT), row));
     }
     
     public void testShouldMatchAll() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.all(), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.all(), row));
     }
     
     public void testShouldMatchNot() throws Exception {
-        assertFalse(SearchUtils.matches(SearchQuery.not(SearchQuery.all()), row));
-        assertTrue(SearchUtils.matches(SearchQuery.not(SearchQuery.headerExists(DATE_FIELD)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.not(SearchQuery.all()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.not(SearchQuery.headerExists(DATE_FIELD)), row));
     }
     
     public void testShouldMatchOr() throws Exception {
-        assertTrue(SearchUtils.matches(SearchQuery.or(SearchQuery.all(), SearchQuery.headerExists(DATE_FIELD)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.or(SearchQuery.headerExists(DATE_FIELD), SearchQuery.all()), row));
-        assertFalse(SearchUtils.matches(SearchQuery.or(SearchQuery.headerExists(DATE_FIELD), SearchQuery.headerExists(DATE_FIELD)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.or(SearchQuery.all(), SearchQuery.all()), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.or(SearchQuery.all(), SearchQuery.headerExists(DATE_FIELD)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.or(SearchQuery.headerExists(DATE_FIELD), SearchQuery.all()), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.or(SearchQuery.headerExists(DATE_FIELD), SearchQuery.headerExists(DATE_FIELD)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.or(SearchQuery.all(), SearchQuery.all()), row));
     }
     
     public void testShouldMatchAnd() throws Exception {
-        assertFalse(SearchUtils.matches(SearchQuery.and(SearchQuery.all(), SearchQuery.headerExists(DATE_FIELD)), row));
-        assertFalse(SearchUtils.matches(SearchQuery.and(SearchQuery.headerExists(DATE_FIELD), SearchQuery.all()), row));
-        assertFalse(SearchUtils.matches(SearchQuery.and(SearchQuery.headerExists(DATE_FIELD), SearchQuery.headerExists(DATE_FIELD)), row));
-        assertTrue(SearchUtils.matches(SearchQuery.and(SearchQuery.all(), SearchQuery.all()), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.and(SearchQuery.all(), SearchQuery.headerExists(DATE_FIELD)), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.and(SearchQuery.headerExists(DATE_FIELD), SearchQuery.all()), row));
+        assertFalse(SearchUtils.isMatch(SearchQuery.and(SearchQuery.headerExists(DATE_FIELD), SearchQuery.headerExists(DATE_FIELD)), row));
+        assertTrue(SearchUtils.isMatch(SearchQuery.and(SearchQuery.all(), SearchQuery.all()), row));
     }
     
     private void setFlags(boolean seen, boolean flagged, boolean answered, boolean draft, 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message