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

java.lang.Object
  extended by org.apache.jackrabbit.core.query.lucene.QueryHitsAdapter
All Implemented Interfaces:
CloseableHits, MultiColumnQueryHits

public class QueryHitsAdapter
extends Object
implements MultiColumnQueryHits

QueryHitsAdapter implements an adapter for QueryHits and exposes them as MultiColumnQueryHits.


Constructor Summary
QueryHitsAdapter(QueryHits hits, Name selectorName)
          Creates a new adapter for hits.
 
Method Summary
 void close()
          Releases resources held by this hits instance.
 Name[] getSelectorNames()
          
 int getSize()
          
 ScoreNode[] nextScoreNodes()
          Returns the next score nodes in this QueryHits or null if there are no more score nodes.
 void skip(int n)
          Skips a n score nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryHitsAdapter

public QueryHitsAdapter(QueryHits hits,
                        Name selectorName)
Creates a new adapter for hits.

Parameters:
hits - the query hits to adapt.
selectorName - the single selector name for the query hits.
Method Detail

nextScoreNodes

public ScoreNode[] nextScoreNodes()
                           throws IOException
Returns the next score nodes in this QueryHits or null if there are no more score nodes.

Specified by:
nextScoreNodes in interface MultiColumnQueryHits
Returns:
the next score nodes in this QueryHits.
Throws:
IOException - if an error occurs while reading from the index.

getSelectorNames

public Name[] getSelectorNames()

Specified by:
getSelectorNames in interface MultiColumnQueryHits
Returns:
the selector names that correspond to the ScoreNodes returned by MultiColumnQueryHits.nextScoreNodes().

close

public void close()
           throws IOException
Releases resources held by this hits instance.

Specified by:
close in interface CloseableHits
Throws:
IOException - if an error occurs while releasing resources.

getSize

public int getSize()

Specified by:
getSize in interface CloseableHits
Returns:
the number of results or -1 if the size is unknown.

skip

public void skip(int n)
          throws IOException
Skips a n score nodes.

Specified by:
skip in interface CloseableHits
Parameters:
n - the number of score nodes to skip.
Throws:
IOException - if an error occurs while skipping.


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