Package org.terrier.realtime.multi
Class MultiIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.IterablePostingImpl
-
- org.terrier.realtime.multi.MultiIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,IterablePosting
,Posting
- Direct Known Subclasses:
BlockMultiIterablePosting
public class MultiIterablePosting extends IterablePostingImpl implements IterablePosting
A posting list implementation used within a MultiIndex. It iterates over the posting lists from multiple index shards.- Since:
- 4.0
- Author:
- Richard McCreadie, Stuart Mackie
-
-
Field Summary
Fields Modifier and Type Field Description int
currentChild
-
Fields inherited from interface org.terrier.structures.postings.IterablePosting
END_OF_LIST, EOL
-
-
Constructor Summary
Constructors Constructor Description MultiIterablePosting(IterablePosting[] constituentIPs, int[] offsets)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WritablePosting
asWritablePosting()
Copy this posting to one free of an iterator.void
close()
Not implemented.boolean
endOfPostings()
Status method to see if this posting list iterator has been finished.int
getDocumentLength()
Return the length of the document of the current posting in tokens.int
getFrequency()
Return the frequency of the term in the current document, in tokens.int
getId()
Return the id of the current posting.int
next()
Move this iterator to the next posting.-
Methods inherited from class org.terrier.structures.postings.IterablePostingImpl
next
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.terrier.structures.postings.IterablePosting
next
-
-
-
-
Constructor Detail
-
MultiIterablePosting
public MultiIterablePosting(IterablePosting[] constituentIPs, int[] offsets)
Constructor.
-
-
Method Detail
-
next
public int next() throws java.io.IOException
Move this iterator to the next posting.- Specified by:
next
in interfaceIterablePosting
- Returns:
- id of next posting, or EOL if end of posting list.
- Throws:
java.io.IOException
-
endOfPostings
public boolean endOfPostings()
Status method to see if this posting list iterator has been finished.- Specified by:
endOfPostings
in interfaceIterablePosting
- Returns:
- true if
IterablePosting.next()
orIterablePosting.next(int)
would return EOL or have returned EOL.
-
getId
public int getId()
Return the id of the current posting. For the inverted index, this is the current docid; for the direct index it corresponds to the current term id.
-
getFrequency
public int getFrequency()
Return the frequency of the term in the current document, in tokens.- Specified by:
getFrequency
in interfacePosting
- Returns:
- frequency of the term in the current document, in tokens.
-
getDocumentLength
public int getDocumentLength()
Return the length of the document of the current posting in tokens. Usually uses the DocumentIndex, may do otherwise if document length statistics are in posting list.- Specified by:
getDocumentLength
in interfacePosting
- Returns:
- length of the document of the current posting in tokens.
-
asWritablePosting
public WritablePosting asWritablePosting()
Copy this posting to one free of an iterator. Kind of like a clone.- Specified by:
asWritablePosting
in interfacePosting
- Returns:
- an identical posting, but which can be manipulated free of this iterator
-
close
public void close() throws java.io.IOException
Not implemented.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-