From jbosscache-commits at lists.jboss.org Tue Jun 24 07:34:05 2008 Content-Type: multipart/mixed; boundary="===============0055033892854004458==" MIME-Version: 1.0 From: jbosscache-commits at lists.jboss.org To: jbosscache-commits at lists.jboss.org Subject: [jbosscache-commits] JBoss Cache SVN: r6012 - searchable/trunk/src/main/java/org/jboss/cache/search. Date: Tue, 24 Jun 2008 07:34:04 -0400 Message-ID: --===============0055033892854004458== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: manik.surtani(a)jboss.com Date: 2008-06-24 07:34:04 -0400 (Tue, 24 Jun 2008) New Revision: 6012 Added: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterato= r.java Log: Added new public interfaces Added: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java = (rev 0) +++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java 2= 008-06-24 11:34:04 UTC (rev 6012) @@ -0,0 +1,27 @@ +package org.jboss.cache.search; + +import org.apache.lucene.search.Sort; + +import java.util.List; + +/** + * // TODO: Javadoc this properly - probably copy the javadoc comments fro= m FullTextQuery since the methods will do pretty much the same thing. + * + * @author Manik Surtani (manik(a)jbo= ss.org) + */ +public interface CacheQuery +{ + List list(); + + QueryResultIterator iterator(); + + void setFirstResult(int index); + + void setMaxResults(int numResults); + + void setFetchSize(int size); + + int getResultSize(); + + void setSort(Sort s); +} Added: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIte= rator.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterat= or.java (rev 0) +++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterat= or.java 2008-06-24 11:34:04 UTC (rev 6012) @@ -0,0 +1,59 @@ +package org.jboss.cache.search; + +import java.util.ListIterator; + +/** + * Iterates over query results + * + * @author Manik Surtani (manik(a)jbo= ss.org) + */ +public interface QueryResultIterator extends ListIterator +{ + /** + * Jumps to a specific index in the iterator. + * + * @param index index to jump to. + * @throws IndexOutOfBoundsException if the index is out of bounds + */ + void jumpToResult(int index) throws IndexOutOfBoundsException; + + /** + * Jumps to the first result + */ + void first(); + + /** + * Jumps to the last result + */ + void last(); + + /** + * Jumps to the one-after-the-first result + */ + void afterFirst(); + + /** + * Jumps to the one-before-the-last result + */ + void beforeLast(); + + /** + * @return true if the current result is the first + */ + boolean isFirst(); + + /** + * @return true if the current result is the last + */ + boolean isLast(); + + /** + * @return true if the current result is one after the first + */ + boolean isAfterFirst(); + + /** + * @return true if the current result is one before the last + */ + boolean isBeforeLast(); +} --===============0055033892854004458==--