public interface DocsAndNodesIterator
This class iterates on doc ids and node labels. The sentinel value
NO_MORE_DOC
(which is set to 2147483647) is used to
indicate the end of the document stream. The sentinel value
NO_MORE_NOD
(which is set to [2147483647]) is used
to indicate the end of a node stream.
Modifier and Type | Field and Description |
---|---|
static int |
NO_MORE_DOC
When returned by
doc() it means there are no more docs in the
iterator. |
static org.apache.lucene.util.IntsRef |
NO_MORE_NOD
When returned by
node() it means there are no more nodes in the
iterator. |
Modifier and Type | Method and Description |
---|---|
int |
doc()
|
boolean |
nextDocument()
Advances to the next document in the set.
|
boolean |
nextNode()
Move to the next node path in the current document.
|
org.apache.lucene.util.IntsRef |
node()
|
boolean |
skipTo(int target)
Skip to the first document beyond (see NOTE below) the current whose
number is greater than or equal to target.
|
static final int NO_MORE_DOC
doc()
it means there are no more docs in the
iterator.static final org.apache.lucene.util.IntsRef NO_MORE_NOD
node()
it means there are no more nodes in the
iterator.boolean nextDocument() throws IOException
IOException
boolean nextNode() throws IOException
Should not be called until nextDocument()
or skipTo(int)
are called for the first time.
nextDocument()
or skipTo(int)
were not called yet.IOException
boolean skipTo(int target) throws IOException
Behaves as if written:
boolean skipTo(int target) { while (nextDocument()) { if (target ≤ doc()) return true; } return false; }Some implementations are considerably more efficient than that.
NOTE: when target ≤ current
implementations must
not advance beyond their current doc()
.
IOException
int doc()
NO_MORE_DOC
if nextDocument()
or
skipTo(int)
were not called yet.
NO_MORE_DOC
if the iterator has exhausted.
org.apache.lucene.util.IntsRef node()
NO_MORE_NOD
if nextNode()
or
#skipTo(int, int[])
were not called yet.
NO_MORE_NOD
if the iterator has exhausted.
Copyright © 2014. All rights reserved.