|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.di.mg4j.search.AbstractDocumentIterator
it.unimi.di.mg4j.index.cluster.DocumentalMergedClusterDocumentIterator
it.unimi.di.mg4j.index.cluster.DocumentalMergedClusterIndexIterator
public class DocumentalMergedClusterIndexIterator
An index iterator merging iterators from local indices.
| Field Summary | |
|---|---|
protected int |
frequency
The precomputed frequency. |
protected int |
id
The id associated with this index iterator. |
protected DocumentalMergedCluster |
index
The reference index. |
protected IndexIterator[] |
indexIterator
A cached copy of the iterators, to avoid type casts. |
protected String |
term
The term associated with this index iterator. |
| Fields inherited from class it.unimi.di.mg4j.index.cluster.DocumentalMergedClusterDocumentIterator |
|---|
currentIterator, documentIterator, globalDocumentPointer, indices, n, queue, strategy, usedIndex |
| Fields inherited from class it.unimi.di.mg4j.search.AbstractDocumentIterator |
|---|
curr, weight |
| Fields inherited from interface it.unimi.di.mg4j.index.IndexIterator |
|---|
END_OF_POSITIONS |
| Fields inherited from interface it.unimi.di.mg4j.search.DocumentIterator |
|---|
END_OF_LIST |
| Constructor Summary | |
|---|---|
DocumentalMergedClusterIndexIterator(DocumentalClusterIndexReader indexReader,
IndexIterator[] indexIterator,
int[] usedIndex)
|
|
| Method Summary | ||
|---|---|---|
|
accept(DocumentIteratorVisitor<T> visitor)
Accepts a visitor. |
|
|
acceptOnTruePaths(DocumentIteratorVisitor<T> visitor)
Accepts a visitor after a call to DocumentIterator.nextDocument(),
limiting recursion to true paths. |
|
int |
count()
Returns the count, that is, the number of occurrences of the term in the current document. |
|
int |
frequency()
Returns the frequency, that is, the number of documents that will be returned by this iterator. |
|
int |
id()
Returns the id of this index iterator. |
|
DocumentalMergedClusterIndexIterator |
id(int id)
Sets the id of this index iterator. |
|
Index |
index()
Returns the index over which this iterator is built. |
|
int |
nextPosition()
Returns the next position at which the term appears in the current document. |
|
Payload |
payload()
Returns the payload, if any, associated with the current document. |
|
String |
term()
Returns the term whose inverted list is returned by this index iterator. |
|
DocumentalMergedClusterIndexIterator |
term(CharSequence term)
Sets the term whose inverted list is returned by this index iterator. |
|
int |
termNumber()
Returns the number of the term whose inverted list is returned by this index iterator. |
|
IndexIterator |
weight(double weight)
Sets the weight of this index iterator. |
|
| Methods inherited from class it.unimi.di.mg4j.index.cluster.DocumentalMergedClusterDocumentIterator |
|---|
dispose, indices, intervalIterator, intervalIterator, intervalIterators, nextDocument, skipTo |
| Methods inherited from class it.unimi.di.mg4j.search.AbstractDocumentIterator |
|---|
document, ensureOnADocument, mayHaveNext, weight |
| 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 |
|---|
dispose, document, indices, intervalIterator, intervalIterator, intervalIterators, mayHaveNext, nextDocument, skipTo, weight |
| Field Detail |
|---|
protected final IndexIterator[] indexIterator
protected final int frequency
protected final DocumentalMergedCluster index
protected String term
protected int id
| Constructor Detail |
|---|
public DocumentalMergedClusterIndexIterator(DocumentalClusterIndexReader indexReader,
IndexIterator[] indexIterator,
int[] usedIndex)
throws IOException
IOException| Method Detail |
|---|
public DocumentalMergedClusterIndexIterator term(CharSequence term)
IndexIteratorUsually, the term is automatically set by Index.documents(CharSequence)
or by IndexReader.documents(CharSequence), but you can
use this method to ensure that IndexIterator.term() doesn't throw
an exception.
term in interface IndexIteratorterm - a character sequence (that will be defensively copied)
that will be assumed to be the term whose inverted list is returned by this index iterator.
public String term()
IndexIteratorUsually, the term is automatically set by IndexReader.documents(CharSequence) or IndexReader.documents(int), but you can
supply your own term with IndexIterator.term(CharSequence).
term in interface IndexIteratorIndexIterator.termNumber()public DocumentalMergedClusterIndexIterator id(int id)
IndexIteratorThe id is an integer associated with each index iterator. It has no specific semantics, and can be used differently in different contexts. A typical usage pattern, for instance, is using it to assign a unique number to the index iterators contained in a composite document iterator (say, numbering consecutively the leaves of the composite).
id in interface IndexIteratorid - the new id for this index iterator.
public int id()
IndexIterator
id in interface IndexIteratorIndexIterator.id(int)public Index index()
IndexIterator
index in interface IndexIteratorpublic int frequency()
IndexIterator
frequency in interface IndexIterator
public Payload payload()
throws IOException
IndexIterator
payload in interface IndexIteratorIOException
public int count()
throws IOException
IndexIterator
count in interface IndexIteratorIOException
public int nextPosition()
throws IOException
IndexIterator
nextPosition in interface IndexIteratorIndexIterator.END_OF_POSITIONS if there are no more positions.
IOException
public <T> T accept(DocumentIteratorVisitor<T> visitor)
throws IOException
DocumentIteratorA document iterator is usually structured as composite,
with operators as internal nodes and IndexIterators
as leaves. This method implements the visitor pattern.
accept in interface DocumentIteratoraccept in class DocumentalMergedClusterDocumentIteratorvisitor - the visitor.
null if the visit was interrupted.
IOException
public <T> T acceptOnTruePaths(DocumentIteratorVisitor<T> visitor)
throws IOException
DocumentIteratorDocumentIterator.nextDocument(),
limiting recursion to true paths.
After a call to DocumentIterator.nextDocument(), a document iterator
is positioned over a document. This call is equivalent to DocumentIterator.accept(DocumentIteratorVisitor),
but visits only along true paths.
We define a true path as a path from the root of the composite that passes only through
nodes whose associated subtree is positioned on the same document of the root. Note that OrDocumentIterators
detach exhausted iterators from the composite tree, so true paths define the subtree that is causing
the current document to satisfy the query represented by this document iterator.
For more elaboration, and the main application of this method, see CounterCollectionVisitor.
acceptOnTruePaths in interface DocumentIteratoracceptOnTruePaths in class DocumentalMergedClusterDocumentIteratorvisitor - the visitor.
null if the visit was interrupted.
IOExceptionDocumentIterator.accept(DocumentIteratorVisitor),
CounterCollectionVisitorpublic int termNumber()
IndexIteratorUsually, the term number is automatically set by IndexReader.documents(CharSequence) or IndexReader.documents(int).
termNumber in interface IndexIteratorIndexIterator.term()public IndexIterator weight(double weight)
DocumentIterator
weight in interface IndexIteratorweight in interface DocumentIteratorweight in class AbstractDocumentIteratorweight - the weight of this index iterator.
DocumentIterator.weight(double)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||