|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An iterator over an inverted list.
An index iterator scans the inverted list of an indexed term. Each
integer returned by the iterator is the index of a document containing the
term. If the index contains counts, they can be obtained after each call to
IntIterator.nextInt()
using count()
. Then, if the index contains
occurrences they can be obtained as an itearator using positions()
, or stored into an array using positions(int[])
.
Note that this interface extends DocumentIterator
.
The intervals returned for a document are exactly length-one intervals
corresponding to the positions returned by positions()
.
Method Summary | |
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[] |
positionArray()
Returns the positions at which the term appears in the current document in an array. |
IntIterator |
positions()
Returns the positions at which the term appears in the current document. |
int |
positions(int[] positions)
Stores the positions at which the term appears in the current document in a given array. |
Methods inherited from interface it.unimi.dsi.mg4j.search.DocumentIterator |
document, indices, intervalIterator, intervalIterator, intervalIterators, nextDocument, skipTo |
Methods inherited from interface it.unimi.dsi.fastutil.ints.IntIterator |
nextInt, skip |
Methods inherited from interface java.util.Iterator |
hasNext, next, remove |
Method Detail |
public int frequency()
public int count()
UnsupportedOperationException
- if this index does not contain counts.public IntIterator positions()
null
if the index does not contain occurrences.
UnsupportedOperationException
- if this index does not contain positions.public int positions(int[] positions)
If the array is not large enough (i.e., it does not contain count()
elements),
this method will return a negative number (the opposite of the count).
positions
- an array that will be used to store positions.
positions
cannot
hold all positions.
UnsupportedOperationException
- if this index does not contain positions.public int[] positionArray()
Implementations are allowed to return the same array across different calls to this method.
UnsupportedOperationException
- if this index does not contain positions.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |