|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.structures.postings.BasicPostingImpl
public class BasicPostingImpl
Implementation of a Posting that is non-iterable.
Field Summary | |
---|---|
protected int |
id
id of the posting |
protected int |
tf
frequency of this posting |
Constructor Summary | |
---|---|
BasicPostingImpl()
Empty constructor - needed for Writable |
|
BasicPostingImpl(int docid,
int frequency)
Constructor that sets both id and frequency |
Method Summary | |
---|---|
WritablePosting |
asWritablePosting()
Copies this posting to one free of an iterator. |
int |
getDocumentLength()
Returns 0 |
int |
getFrequency()
Return the frequency of the term in the current document |
int |
getId()
Return the id of the current posting. |
void |
readFields(java.io.DataInput in)
Reads the a single posting (not an iterable posting - use BitPostingIndex for that) |
void |
setId(int _id)
Set the id of this posting |
java.lang.String |
toString()
Makes a human readable form of this posting |
void |
write(java.io.DataOutput out)
Writes the current posting (not an iterable posting - use DirectInvertedOutputStream for that). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int id
protected int tf
Constructor Detail |
---|
public BasicPostingImpl()
public BasicPostingImpl(int docid, int frequency)
Method Detail |
---|
public int getId()
getId
in interface Posting
public int getFrequency()
getFrequency
in interface Posting
public void readFields(java.io.DataInput in) throws java.io.IOException
readFields
in interface org.apache.hadoop.io.Writable
java.io.IOException
public void write(java.io.DataOutput out) throws java.io.IOException
write
in interface org.apache.hadoop.io.Writable
java.io.IOException
public void setId(int _id)
setId
in interface Posting
public int getDocumentLength()
getDocumentLength
in interface Posting
public WritablePosting asWritablePosting()
asWritablePosting
in interface Posting
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |