|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PostingsIterator
An interface for an iterator that can be used to step through the a
postings file entry. Each class that implements Entry
will
have to be able to generate an iterator that implements this interface.
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Compares this postings iterator to another one. |
boolean |
findID(int id)
Finds the given document in the entry we're iterating through, if it exists. |
int |
get(int[] ids)
Reads a number of IDs into the provided array. |
int |
get(int[] ids,
float[] weights)
Reads a number of IDs and the associated weights into the provided arrays. |
int |
get(int[] ids,
int[] freq)
Reads a number of IDs and frequencies into the provided arrays. |
PostingsIteratorFeatures |
getFeatures()
Gets the features that were used to create this iterator. |
int |
getFreq()
Gets the frequency of the term in the current document. |
int |
getID()
Gets the document sequence number that the iterator is currently pointing at. |
int |
getN()
Gets the number of IDs that this iterator will produce. |
float |
getWeight()
Gets the weight of the term in the current document, as generated by some weighting function. |
boolean |
next()
Moves to the next document in this entry. |
void |
reset()
Resets the iterator to the beginning of the entry. |
Method Detail |
---|
int getN()
int get(int[] ids)
int get(int[] ids, int[] freq)
ids
- an array into which IDs will be placed. If possible,
the array will be filled.freq
- an array into which frequencies will be placed. If
possible, the array will be filled.
int get(int[] ids, float[] weights)
ids
- an array into which IDs will be placed. If possible,
the array will be filled.weights
- an array into which weights will be placed. If
possible, the array will be filled.
boolean next()
java.util.Iterator.next()
method in that it
does not return an object. This would require too much object
creation overhead during retrieval, and saves the whole
hasNext()
/next()
function call overhead.
You should use the accessor functions for the iterator to find out
the actual document, position, etc. that the iterator is at.
boolean findID(int id)
id
- The ID that we want to find.
reset()
void reset()
next
method is called.
int getID()
float getWeight()
int getFreq()
int compareTo(java.lang.Object o)
PostingsIteratorFeatures getFeatures()
null
if no features were used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |