|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.search.AbstractDocumentIterator
public abstract class AbstractDocumentIterator
An abstract iterator on documents that and
provides support for the DocumentIterator.weight()
/DocumentIterator.weight(double)
methods.
Instances of this class expect implementation to keep track of the current document
of the iterator. The special value -1 denotes an iterator that has not still been accessed,
and the special value DocumentIterator.END_OF_LIST
denotes an iterator that has been exhausted.
Methods performing actions depending on the last document returned should throw an IllegalStateException
if called when curr
is -1 or DocumentIterator.END_OF_LIST
. You just need to call ensureOnADocument()
.
Field Summary | |
---|---|
protected int |
curr
The current document of the iterator. |
protected double |
weight
The weight of this iterator. |
Fields inherited from interface it.unimi.di.mg4j.search.DocumentIterator |
---|
END_OF_LIST |
Constructor Summary | |
---|---|
AbstractDocumentIterator()
|
Method Summary | |
---|---|
int |
document()
Returns the current document. |
protected void |
ensureOnADocument()
|
boolean |
mayHaveNext()
Returns whether there may be a next document, possibly with false positives. |
double |
weight()
Returns the weight associated with this iterator. |
DocumentIterator |
weight(double weight)
Sets the weight of this index iterator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface it.unimi.di.mg4j.search.DocumentIterator |
---|
accept, acceptOnTruePaths, dispose, indices, intervalIterator, intervalIterator, intervalIterators, nextDocument, skipTo |
Field Detail |
---|
protected int curr
AbstractDocumentIterator
protected double weight
Constructor Detail |
---|
public AbstractDocumentIterator()
Method Detail |
---|
public boolean mayHaveNext()
DocumentIterator
mayHaveNext
in interface DocumentIterator
public double weight()
DocumentIterator
The number returned by this method has no fixed semantics: different scorers might choose different interpretations, or even ignore it.
weight
in interface DocumentIterator
public DocumentIterator weight(double weight)
DocumentIterator
weight
in interface DocumentIterator
weight
- the weight of this index iterator.
protected final void ensureOnADocument()
public int document()
document
in interface DocumentIterator
curr
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |