public abstract class ConstrainedNodesEnum extends DocsNodesAndPositionsEnum
DocsNodesAndPositionsEnum
that filters nodes that
do not satisfy some constraints.
This DocsNodesAndPositionsEnum
wraps another
DocsNodesAndPositionsEnum
and applies the node constraints. It
filters all the nodes that do not satisfy the constraints.
NodeUtils#isConstraintSatisfied(int[], int[], int[], boolean)
Modifier and Type | Field and Description |
---|---|
protected DocsNodesAndPositionsEnum |
docsEnum |
NO_MORE_DOC, NO_MORE_NOD
NO_MORE_POS
Constructor and Description |
---|
ConstrainedNodesEnum(DocsNodesAndPositionsEnum docsEnum) |
Modifier and Type | Method and Description |
---|---|
int |
doc()
Returns the following:
-1 or
DocsAndNodesIterator.NO_MORE_DOC if DocsAndNodesIterator.nextDocument() or
DocsAndNodesIterator.skipTo(int) were not called yet. |
boolean |
nextDocument()
Advances to the next document in the set.
|
abstract boolean |
nextNode()
Move to the next node path in the current document.
|
boolean |
nextPosition()
Move to the next position in the current node matching the query.
|
org.apache.lucene.util.IntsRef |
node()
Returns the following:
-1 or
DocsAndNodesIterator.NO_MORE_NOD if DocsAndNodesIterator.nextNode() or
#skipTo(int, int[]) were not called yet. |
int |
nodeFreqInDoc()
Returns node frequency in the current document.
|
int |
pos()
Returns the following:
-1 or
PositionsIterator.NO_MORE_POS if PositionsIterator.nextPosition() were not called
yet. |
boolean |
skipTo(int target)
Skip to the first document beyond (see NOTE below) the current whose
number is greater than or equal to target.
|
int |
termFreqInNode()
Returns term frequency in the current node.
|
attributes
protected final DocsNodesAndPositionsEnum docsEnum
public ConstrainedNodesEnum(DocsNodesAndPositionsEnum docsEnum)
public boolean nextDocument() throws IOException
DocsAndNodesIterator
IOException
public abstract boolean nextNode() throws IOException
DocsAndNodesIterator
Should not be called until DocsAndNodesIterator.nextDocument()
or DocsAndNodesIterator.skipTo(int)
are called for the first time.
DocsAndNodesIterator.nextDocument()
or DocsAndNodesIterator.skipTo(int)
were not called yet.IOException
public boolean skipTo(int target) throws IOException
DocsAndNodesIterator
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 DocsAndNodesIterator.doc()
.
IOException
public int doc()
DocsAndNodesIterator
DocsAndNodesIterator.NO_MORE_DOC
if DocsAndNodesIterator.nextDocument()
or
DocsAndNodesIterator.skipTo(int)
were not called yet.
DocsAndNodesIterator.NO_MORE_DOC
if the iterator has exhausted.
public org.apache.lucene.util.IntsRef node()
DocsAndNodesIterator
DocsAndNodesIterator.NO_MORE_NOD
if DocsAndNodesIterator.nextNode()
or
#skipTo(int, int[])
were not called yet.
DocsAndNodesIterator.NO_MORE_NOD
if the iterator has exhausted.
public boolean nextPosition() throws IOException
PositionsIterator
Should not be called until DocsAndNodesIterator.nextNode()
or
DocsAndNodesIterator#skipTo(int, int)
are called for the first
time.
DocsAndNodesIterator.nextNode()
or
DocsAndNodesIterator#skipTo(int, int)
were not called yet.IOException
public int pos()
PositionsIterator
PositionsIterator.NO_MORE_POS
if PositionsIterator.nextPosition()
were not called
yet.
PositionsIterator.NO_MORE_POS
if the iterator has exhausted.
public int termFreqInNode() throws IOException
DocsNodesAndPositionsEnum
DocsAndNodesIterator.nextNode()
is first called,
nor after DocsAndNodesIterator.nextNode()
returns false or
DocsAndNodesIterator.node()
returns DocsAndNodesIterator.NO_MORE_NOD
.termFreqInNode
in class DocsNodesAndPositionsEnum
IOException
public int nodeFreqInDoc() throws IOException
DocsNodesAndPositionsEnum
#nextDoc
is first called,
nor after #nextDoc
returns false or
DocsAndNodesIterator.doc()
returns DocsAndNodesIterator.NO_MORE_DOC
.nodeFreqInDoc
in class DocsNodesAndPositionsEnum
IOException
Copyright © 2014. All rights reserved.