public class BasicPostingImpl extends Object implements WritablePosting
Modifier and Type | Field and Description |
---|---|
protected int |
dl |
protected int |
id
id of the posting
|
protected int |
tf
frequency of this posting
|
Constructor and Description |
---|
BasicPostingImpl()
Empty constructor - needed for Writable
|
BasicPostingImpl(int docid,
int frequency)
Constructor that sets both id and frequency
|
Modifier and Type | Method and Description |
---|---|
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(DataInput in)
Reads the a single posting (not an iterable posting - use BitPostingIndex for that)
|
void |
setDocumentLength(int l) |
void |
setId(int _id)
Set the id of this posting
|
void |
setTf(int tf)
Set the term frequency in the document
|
String |
toString()
Makes a human readable form of this posting
|
void |
write(DataOutput out)
Writes the current posting (not an iterable posting - use DirectInvertedOutputStream for that).
|
protected int dl
protected int id
protected int tf
public BasicPostingImpl()
public BasicPostingImpl(int docid, int frequency)
public final int getId()
public final int getFrequency()
getFrequency
in interface Posting
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void setId(int _id)
public int getDocumentLength()
getDocumentLength
in interface Posting
public WritablePosting asWritablePosting()
asWritablePosting
in interface Posting
public String toString()
public void setDocumentLength(int l)
setDocumentLength
in interface WritablePosting
public void setTf(int tf)
tf
- Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow