com.arsdigita.search
Class CachedResultSet

java.lang.Object
  extended bycom.arsdigita.search.CachedResultSet
All Implemented Interfaces:
ResultSet

public class CachedResultSet
extends Object
implements ResultSet


Constructor Summary
CachedResultSet(QuerySpecification spec, ResultSet results, int size)
           
 
Method Summary
 void close()
          Releases any resources associated with this result set.
 long getCount()
          Returns the total number of results in the set
 Iterator getDocuments(long offset, long count)
          Gets an iterator for the page of results between offset and offset+count
 String getEngine()
          Return the query engine used to generate the result set
 long getQueryTime()
          Return the elapsed time for generating this result set from the original query specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedResultSet

public CachedResultSet(QuerySpecification spec,
                       ResultSet results,
                       int size)
Method Detail

getDocuments

public Iterator getDocuments(long offset,
                             long count)
Gets an iterator for the page of results between offset and offset+count

Specified by:
getDocuments in interface ResultSet
Parameters:
offset - the first hit, starting from 0
count - the maximum number of results to return
Returns:
an iterator of Document objects
Throws:
java.lang.IllegalOperationException - if close has been called

getCount

public long getCount()
Returns the total number of results in the set

Specified by:
getCount in interface ResultSet
Returns:
the result count

getEngine

public String getEngine()
Return the query engine used to generate the result set

Specified by:
getEngine in interface ResultSet
Returns:
the query engine

getQueryTime

public long getQueryTime()
Return the elapsed time for generating this result set from the original query specification.

Specified by:
getQueryTime in interface ResultSet
Returns:
the query time in milliseconds

close

public void close()
Releases any resources associated with this result set. This is a no-op if the result set doesn't have any system resources allocated

Specified by:
close in interface ResultSet


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC