org.apache.jackrabbit.core.query.lucene
Class LuceneQueryHits

java.lang.Object
  extended by org.apache.jackrabbit.core.query.lucene.AbstractQueryHits
      extended by org.apache.jackrabbit.core.query.lucene.LuceneQueryHits
All Implemented Interfaces:
CloseableHits, QueryHits

public class LuceneQueryHits
extends AbstractQueryHits

Wraps the lucene Hits object and adds a close method that allows to release resources after a query has been executed and the results have been read completely.


Constructor Summary
LuceneQueryHits(org.apache.lucene.search.Hits hits, org.apache.lucene.index.IndexReader reader)
          Creates a new QueryHits instance wrapping hits.
 
Method Summary
 int getSize()
          This default implementation returns -1.
 org.apache.jackrabbit.core.query.lucene.ScoreNode nextScoreNode()
          Returns the next score node in this QueryHits or null if there are no more score nodes.
 void skip(int n)
          Skips n hits.
 
Methods inherited from class org.apache.jackrabbit.core.query.lucene.AbstractQueryHits
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneQueryHits

public LuceneQueryHits(org.apache.lucene.search.Hits hits,
                       org.apache.lucene.index.IndexReader reader)
Creates a new QueryHits instance wrapping hits.

Parameters:
hits - the lucene hits.
reader - the IndexReader in use by hits.
Method Detail

getSize

public final int getSize()
This default implementation returns -1.

Specified by:
getSize in interface CloseableHits
Overrides:
getSize in class AbstractQueryHits
Returns:
-1.

nextScoreNode

public final org.apache.jackrabbit.core.query.lucene.ScoreNode nextScoreNode()
                                                                      throws IOException
Returns the next score node in this QueryHits or null if there are no more score nodes.

Returns:
the next score node in this QueryHits.
Throws:
IOException - if an error occurs while reading from the index.

skip

public void skip(int n)
          throws IOException
Skips n hits.

Specified by:
skip in interface CloseableHits
Overrides:
skip in class AbstractQueryHits
Parameters:
n - the number of hits to skip.
Throws:
IOException - if an error occurs while skipping.


Copyright © 2004-2008 The Apache Software Foundation. All Rights Reserved.