Class FieldIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.BasicPostingImpl
-
- org.terrier.structures.postings.bit.BasicIterablePosting
-
- org.terrier.structures.postings.bit.FieldIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Serializable,java.lang.AutoCloseable,org.apache.hadoop.io.Writable,FieldPosting,IterablePosting,Posting,WritablePosting
public class FieldIterablePosting extends BasicIterablePosting implements FieldPosting
A posting iterator for field postings.- Since:
- 3.0
- Author:
- Craig Macdonald
- See Also:
Posting,IterablePosting,FieldPosting, 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 FieldIterablePosting(int _fieldCount)contructorFieldIterablePosting(BitIn fileReader, int entries, DocumentIndex _doi, int _fieldCount)constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WritablePostingasWritablePosting()Get this posting as a WritablePostingint[]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.intnext()Move this iterator to the next posting.voidreadFields(java.io.DataInput in)Read this posting from specified inputstreamvoidsetFieldLengths(int[] fl).java.lang.StringtoString()Makes a human readable form of this postingvoidwrite(java.io.DataOutput out)Write this posting to specified outputstream-
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
-
FieldIterablePosting
public FieldIterablePosting(int _fieldCount)
contructor- Parameters:
_fieldCount-
-
FieldIterablePosting
public FieldIterablePosting(BitIn fileReader, int entries, DocumentIndex _doi, int _fieldCount) throws java.io.IOException
constructor- Parameters:
fileReader-entries-_doi-_fieldCount-- Throws:
java.io.IOException
-
-
Method Detail
-
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.
-
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
-
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.IOExceptionRead this posting from specified inputstream- 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.IOExceptionWrite this posting to specified outputstream- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Overrides:
writein classBasicPostingImpl- Throws:
java.io.IOException
-
asWritablePosting
public WritablePosting asWritablePosting()
Get this posting as a WritablePosting- 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()
Description copied from class:BasicPostingImplMakes a human readable form of this posting- Overrides:
toStringin classBasicIterablePosting
-
-