Class BlockFieldIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.BasicPostingImpl
-
- org.terrier.structures.postings.bit.BasicIterablePosting
-
- org.terrier.structures.postings.bit.BlockFieldIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,org.apache.hadoop.io.Writable,BlockPosting,FieldPosting,IterablePosting,Posting,WritablePosting
public class BlockFieldIterablePosting extends BasicIterablePosting implements BlockPosting, FieldPosting
class BlockFieldIterablePosting- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.terrier.structures.postings.bit.BasicIterablePosting
bitFileReader, doi, 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 BlockFieldIterablePosting(int _fieldCount)Make a new posting that can be loaded using Writable methodsBlockFieldIterablePosting(BitIn _bitFileReader, int _numEntries, DocumentIndex doi, int _fieldCount)Make a new posting iterator that is read from a BitIn stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WritablePostingasWritablePosting()Copy this posting to one free of an iterator.int[]getFieldFrequencies()Returns the frequencies of the term in each field of the document.int[]getFieldLengths()Returns the lengths of the each field in the current document.int[]getPositions()Return the positions of occurrences of the term in the current document.intnext()Move this iterator to the next posting.voidreadFields(java.io.DataInput in)Reads the a single posting (not an iterable posting - use BitPostingIndex for that)voidsetFieldLengths(int[] fl).java.lang.StringtoString()Makes a human readable form of this postingvoidwrite(java.io.DataOutput out)Writes the current posting (not an iterable posting - use DirectInvertedOutputStream for that).-
Methods inherited from class org.terrier.structures.postings.bit.BasicIterablePosting
close, endOfPostings, getDocumentLength, next
-
Methods inherited from class org.terrier.structures.postings.BasicPostingImpl
getFrequency, getId, setDocumentLength, setId, setTf
-
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
getDocumentLength, getFrequency, getId
-
-
-
-
Constructor Detail
-
BlockFieldIterablePosting
public BlockFieldIterablePosting(int _fieldCount)
Make a new posting that can be loaded using Writable methods- Parameters:
_fieldCount- number of fields to expect
-
BlockFieldIterablePosting
public BlockFieldIterablePosting(BitIn _bitFileReader, int _numEntries, DocumentIndex doi, int _fieldCount) throws java.io.IOException
Make a new posting iterator that is read from a BitIn stream.- Parameters:
_bitFileReader- BitIn stream containing postings_numEntries- number of postings to read from streamdoi- DocumentIndex to read document and field lengths from_fieldCount- number of fields to expect- Throws:
java.io.IOException
-
-
Method Detail
-
next
public int next() throws java.io.IOExceptionMove this iterator to the next posting.- Specified by:
nextin interfaceIterablePosting- Overrides:
nextin classBasicIterablePosting- Returns:
- id of next posting, or EOL if end of posting list.
- Throws:
java.io.IOException
-
getPositions
public int[] getPositions()
Return the positions of occurrences of the term in the current document.- Specified by:
getPositionsin interfaceBlockPosting- Returns:
- the positions of occurrences of the term in the current document.
-
getFieldFrequencies
public int[] getFieldFrequencies()
Returns the frequencies of the term in each field of the document.- Specified by:
getFieldFrequenciesin interfaceFieldPosting- Returns:
- the frequencies of the term in each field of the document.
-
setFieldLengths
public void setFieldLengths(int[] fl)
. This operation is unsupported.- Specified by:
setFieldLengthsin interfaceFieldPosting
-
getFieldLengths
public int[] getFieldLengths()
Returns the lengths of the each field in the current document.- Specified by:
getFieldLengthsin interfaceFieldPosting- Returns:
- the lengths of the each field in the current document.
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOExceptionReads the a single posting (not an iterable posting - use BitPostingIndex for that)- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Overrides:
readFieldsin classBasicPostingImpl- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOExceptionWrites the current posting (not an iterable posting - use DirectInvertedOutputStream for that). Compression using this method is not expected to be comparable to bit-level compression.- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Overrides:
writein classBasicPostingImpl- Throws:
java.io.IOException
-
asWritablePosting
public WritablePosting asWritablePosting()
Copy this posting to one free of an iterator. Kind of like a clone.- Specified by:
asWritablePostingin interfacePosting- Overrides:
asWritablePostingin classBasicIterablePosting- Returns:
- an identical posting, but which can be manipulated free of this iterator
-
toString
public java.lang.String toString()
Makes a human readable form of this posting- Overrides:
toStringin classBasicIterablePosting
-
-