Package org.terrier.structures.postings
Class FieldPostingImpl
- java.lang.Object
-
- org.terrier.structures.postings.BasicPostingImpl
-
- org.terrier.structures.postings.FieldPostingImpl
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.hadoop.io.Writable,FieldPosting,Posting,WritablePosting
public class FieldPostingImpl extends BasicPostingImpl implements FieldPosting
Implementation of a posting containing fields- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.terrier.structures.postings.BasicPostingImpl
dl, id, tf
-
-
Constructor Summary
Constructors Constructor Description FieldPostingImpl()default constructorFieldPostingImpl(int _fieldCount)constructorFieldPostingImpl(int[] _fieldFrequencies)constructorFieldPostingImpl(int id, int tf, int _fieldCount)constructorFieldPostingImpl(int id, int tf, int[] _fieldFrequencies)constructor
-
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.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.BasicPostingImpl
getDocumentLength, 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
-
FieldPostingImpl
public FieldPostingImpl()
default constructor
-
FieldPostingImpl
public FieldPostingImpl(int id, int tf, int _fieldCount)constructor- Parameters:
id-tf-_fieldCount-
-
FieldPostingImpl
public FieldPostingImpl(int id, int tf, int[] _fieldFrequencies)constructor- Parameters:
id-tf-_fieldFrequencies-
-
FieldPostingImpl
public FieldPostingImpl(int[] _fieldFrequencies)
constructor- Parameters:
_fieldFrequencies-
-
FieldPostingImpl
public FieldPostingImpl(int _fieldCount)
constructor- Parameters:
_fieldCount-
-
-
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.
-
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.
-
setFieldLengths
public void setFieldLengths(int[] fl)
- Specified by:
setFieldLengthsin interfaceFieldPosting
-
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.IOExceptionDescription copied from class:BasicPostingImplWrites 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 classBasicPostingImpl- 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 classBasicPostingImpl
-
-