Class BasicIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.BasicPostingImpl
-
- org.terrier.structures.postings.bit.BasicIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Serializable
,java.lang.AutoCloseable
,org.apache.hadoop.io.Writable
,IterablePosting
,Posting
,WritablePosting
- Direct Known Subclasses:
BasicIterablePostingDocidOnly
,BlockFieldIterablePosting
,BlockIterablePosting
,FieldIterablePosting
public class BasicIterablePosting extends BasicPostingImpl implements IterablePosting
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BitIn
bitFileReader
protected DocumentIndex
doi
protected int
numEntries
-
Fields inherited from class org.terrier.structures.postings.BasicPostingImpl
dl, id, tf
-
Fields inherited from interface org.terrier.structures.postings.IterablePosting
END_OF_LIST, EOL
-
-
Constructor Summary
Constructors Constructor Description BasicIterablePosting()
Empty constructor used ONLY for reflectionBasicIterablePosting(BitIn _bitFileReader, int _numEntries, DocumentIndex _doi)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WritablePosting
asWritablePosting()
void
close()
boolean
endOfPostings()
int
getDocumentLength()
Returns 0int
next()
int
next(int target)
java.lang.String
toString()
Makes a human readable form of this posting-
Methods inherited from class org.terrier.structures.postings.BasicPostingImpl
getFrequency, getId, readFields, setDocumentLength, setId, setTf, write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.terrier.structures.postings.Posting
getFrequency, getId
-
-
-
-
Field Detail
-
numEntries
protected int numEntries
-
bitFileReader
protected BitIn bitFileReader
-
doi
protected DocumentIndex doi
-
-
Constructor Detail
-
BasicIterablePosting
public BasicIterablePosting()
Empty constructor used ONLY for reflection
-
BasicIterablePosting
public BasicIterablePosting(BitIn _bitFileReader, int _numEntries, DocumentIndex _doi) throws java.io.IOException
Constructor- Parameters:
_bitFileReader
- The bit file where we read the postings from_numEntries
- Total number of postings to read before returning EOL_doi
- The document index to get the doc length of the current docid- Throws:
java.io.IOException
-
-
Method Detail
-
endOfPostings
public boolean endOfPostings()
- Specified by:
endOfPostings
in interfaceIterablePosting
-
getDocumentLength
public int getDocumentLength()
Description copied from class:BasicPostingImpl
Returns 0- Specified by:
getDocumentLength
in interfacePosting
- Overrides:
getDocumentLength
in classBasicPostingImpl
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
asWritablePosting
public WritablePosting asWritablePosting()
Description copied from class:BasicPostingImpl
- Specified by:
asWritablePosting
in interfacePosting
- Overrides:
asWritablePosting
in classBasicPostingImpl
-
toString
public java.lang.String toString()
Description copied from class:BasicPostingImpl
Makes a human readable form of this posting- Overrides:
toString
in classBasicPostingImpl
-
next
public int next() throws java.io.IOException
- Specified by:
next
in interfaceIterablePosting
- Throws:
java.io.IOException
-
next
public int next(int target) throws java.io.IOException
- Specified by:
next
in interfaceIterablePosting
- Throws:
java.io.IOException
-
-