Class AbstractQueryHits
- java.lang.Object
-
- org.apache.jackrabbit.core.query.lucene.AbstractQueryHits
-
- All Implemented Interfaces:
CloseableHits
,QueryHits
- Direct Known Subclasses:
ChildNodesQueryHits
,DefaultQueryHits
,NodeTraversingQueryHits
,SortedLuceneQueryHits
public abstract class AbstractQueryHits extends Object implements QueryHits
AbstractQueryHits
serves as a base class forQueryHits
implementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractQueryHits()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This default implementation does nothing.int
getSize()
This default implementation returns-1
.void
skip(int n)
Provides a default implementation:-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.core.query.lucene.QueryHits
nextScoreNode
-
-
-
-
Method Detail
-
close
public void close() throws IOException
This default implementation does nothing.- Specified by:
close
in interfaceCloseableHits
- Throws:
IOException
- if an error occurs while releasing resources.
-
skip
public void skip(int n) throws IOException
Provides a default implementation:while (n-- > 0) { if (nextScoreNode() == null) { return; } }
Sub classes may overwrite this method and implement are more efficient way to skip hits.- Specified by:
skip
in interfaceCloseableHits
- Parameters:
n
- the number of hits to skip.- Throws:
IOException
- if an error occurs while skipping.
-
getSize
public int getSize()
This default implementation returns-1
.- Specified by:
getSize
in interfaceCloseableHits
- Returns:
-1
.
-
-