Package org.terrier.structures.postings
Class BlockPostingImpl
- java.lang.Object
-
- org.terrier.structures.postings.BasicPostingImpl
-
- org.terrier.structures.postings.BlockPostingImpl
-
- All Implemented Interfaces:
java.io.Serializable
,org.apache.hadoop.io.Writable
,BlockPosting
,Posting
,WritablePosting
- Direct Known Subclasses:
BlockFieldPostingImpl
public class BlockPostingImpl extends BasicPostingImpl implements BlockPosting
BlockPostingImpl class- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.terrier.structures.postings.BasicPostingImpl
dl, id, tf
-
-
Constructor Summary
Constructors Constructor Description BlockPostingImpl()
empty constructor for Writable implementationBlockPostingImpl(int docid, int frequency, int[] _positions)
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.int[]
getPositions()
Return the positions of occurrences of the term in the current document.void
readFields(java.io.DataInput in)
Reads the a single posting (not an iterable posting - use BitPostingIndex for that)java.lang.String
toString()
Makes a human readable form of this postingvoid
write(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
-
-
-
-
Method Detail
-
getPositions
public int[] getPositions()
Return the positions of occurrences of the term in the current document.- Specified by:
getPositions
in interfaceBlockPosting
- Returns:
- the positions of occurrences of the term in the current document.
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException
Reads the a single posting (not an iterable posting - use BitPostingIndex for that)- Specified by:
readFields
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
readFields
in classBasicPostingImpl
- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOException
Writes 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:
write
in interfaceorg.apache.hadoop.io.Writable
- Overrides:
write
in 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:
asWritablePosting
in interfacePosting
- Overrides:
asWritablePosting
in 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:
toString
in classBasicPostingImpl
-
-