public abstract class AbstractQueryHits extends Object implements QueryHits
AbstractQueryHits
serves as a base class for QueryHits
implementations.Constructor and Description |
---|
AbstractQueryHits() |
Modifier and Type | Method and Description |
---|---|
void |
close()
This default implementation does nothing.
|
int |
getSize()
This default implementation returns
-1 . |
void |
skip(int n)
Provides a default implementation:
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
nextScoreNode
public void close() throws IOException
close
in interface CloseableHits
IOException
- if an error occurs while releasing resources.public void skip(int n) throws IOException
while (n-- > 0) { if (nextScoreNode() == null) { return; } }Sub classes may overwrite this method and implement are more efficient way to skip hits.
skip
in interface CloseableHits
n
- the number of hits to skip.IOException
- if an error occurs while skipping.public int getSize()
-1
.getSize
in interface CloseableHits
-1
.Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.