| it.unimi.dsi.mg4j.index.IndexIterator
All known Subclasses: it.unimi.dsi.mg4j.index.cluster.DocumentalMergedClusterIndexIterator, it.unimi.dsi.mg4j.index.AbstractIndexIterator, it.unimi.dsi.mg4j.index.MultiTermIndexIterator, it.unimi.dsi.mg4j.index.cluster.DocumentalConcatenatedClusterIndexIterator, test.it.unimi.dsi.mg4j.search.IntArrayIndexIterator,
Method Summary | |
public int | count() Returns the count, that is, the number of occurrences of the term in the current document. | public int | frequency() Returns the frequency, that is, the number of documents that will be returned by this iterator. | public void | id(int id) Sets the id of this index iterator.
The id is an integer associated to each index iterator. | public int | id() Returns the id of this index iterator. | public Index | index() Returns the index over which this iterator is built. | public Payload | payload() Returns the payload, if any, associated with the current document. | public int[] | positionArray() Returns the positions at which the term appears in the current document in an array. | public IntIterator | positions() Returns the positions at which the term appears in the current document. | public int | positions(int[] positions) Stores the positions at which the term appears in the current document in a given array. | public String | term() Returns the term whose inverted list is returned by this index iterator. | public void | term(CharSequence term) Sets the term whose inverted list is returned by this index iterator. | public int | termNumber() Returns the number of the term whose inverted list is returned by this index iterator.
Usually, the term number is automatically set by
IndexReader.documents(CharSequence) or
IndexReader.documents(int) .
Instances of
Index.EmptyIndexIterator can return -1 .
the number of the term over which this iterator is built, or -1 for an Index.EmptyIndexIterator. |
count | public int count() throws IOException(Code) | | Returns the count, that is, the number of occurrences of the term in the current document.
the count (number of occurrences) of the term in the current document. throws: UnsupportedOperationException - if the index of this iterator does not contain counts. |
frequency | public int frequency() throws IOException(Code) | | Returns the frequency, that is, the number of documents that will be returned by this iterator.
the number of documents that will be returned by this iterator. |
id | public void id(int id)(Code) | | Sets the id of this index iterator.
The id is an integer associated to 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 composited document iterator (say,
numbering consecutively the leaves of the composite).
Instances of
Index.EmptyIndexIterator are allowed to ignore
silently calls to this method.
Parameters: id - the new id for this index iterator. |
index | public Index index()(Code) | | Returns the index over which this iterator is built.
the index over which this iterator is built. |
payload | public Payload payload() throws IOException(Code) | | Returns the payload, if any, associated with the current document.
the payload associated with the current document. |
positionArray | public int[] positionArray() throws IOException(Code) | | Returns the positions at which the term appears in the current document in an array.
Implementations are allowed to return the same array across different calls to this method.
an array whose first elements contain the document positions. throws: UnsupportedOperationException - if the index of this iterator does not contain positions. |
positions | public IntIterator positions() throws IOException(Code) | | Returns the positions at which the term appears in the current document.
the positions of the current document in which the current term appears. throws: UnsupportedOperationException - if the index of this iterator does not contain positions. |
positions | public int positions(int[] positions) throws IOException(Code) | | Stores the positions at which the term appears in the current document in a given array.
If the array is not large enough (i.e., it does not contain
IndexIterator.count() elements),
this method will return a negative number (the opposite of the count).
Parameters: positions - an array that will be used to store positions. the ; it will have the sign changed if positions cannothold all positions. throws: UnsupportedOperationException - if the index of this iterator does not contain positions. |
|
|