org.terrier.structures
Class BasicTermStatsLexiconEntry

java.lang.Object
  extended by org.terrier.structures.LexiconEntry
      extended by org.terrier.structures.BasicTermStatsLexiconEntry
All Implemented Interfaces:
java.io.Serializable, org.apache.hadoop.io.Writable, EntryStatistics, Pointer

public class BasicTermStatsLexiconEntry
extends LexiconEntry

A LexiconEntry which only contains EntryStatistics

Author:
Craig Macdonald
See Also:
Serialized Form

Field Summary
protected  int n_t
           
protected  int termId
           
protected  int TF
           
 
Constructor Summary
BasicTermStatsLexiconEntry()
          Constructs an instance of the BasicTermStatsLexiconEntry.
BasicTermStatsLexiconEntry(int _TF, int _n_t, int _termId)
          Constructs an instance of the BasicTermStatsLexiconEntry.
 
Method Summary
 void add(EntryStatistics le)
          Increment the statistics of this object by that of another
 int getDocumentFrequency()
          The number of documents that the entry (term) occurred in
 int getFrequency()
          The frequency (total number of occurrences) of the entry (term).
 int getNumberOfEntries()
          Returns number of "things" that this pointer refers to
 long getOffset()
          Get the offset (bytes)
 byte getOffsetBits()
          Get the number of bits for the offset
 int getTermId()
          The id of the term
 java.lang.String pointerToString()
          Returns a textual representation of the pointer alone
 void readFields(java.io.DataInput in)
          
 void setAll(int _TF, int _n_t, int _termId)
          Sets the term frequency, document frequency and term id for this term
 void setBitIndexPointer(BitIndexPointer pointer)
          Sets the bit index pointer to this LexiconEntry
 void setDocumentFrequency(int _n_t)
          Sets the document frequency
 void setFrequency(int _TF)
          Sets the frequency for this term
 void setNumberOfEntries(int n)
          Set the number of "things that the pointer refers to
 void setOffset(BitFilePosition pos)
          Sets the offset using a BitFilePosition
 void setOffset(long bytes, byte bits)
          Set the offset in terms of bits and bytes
 void setPointer(Pointer p)
          Sets the pointer within this object to that represented by the specified pointer
 void setStatistics(int _n_t, int _TF)
          Set the document frequency and term frequency
 void setTermId(int _termId)
          Set the term ID
 void subtract(EntryStatistics le)
          Decrement the statistics of this object by that of another
 void write(java.io.DataOutput out)
          
 
Methods inherited from class org.terrier.structures.LexiconEntry
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

n_t

protected int n_t

TF

protected int TF

termId

protected int termId
Constructor Detail

BasicTermStatsLexiconEntry

public BasicTermStatsLexiconEntry()
Constructs an instance of the BasicTermStatsLexiconEntry.


BasicTermStatsLexiconEntry

public BasicTermStatsLexiconEntry(int _TF,
                                  int _n_t,
                                  int _termId)
Constructs an instance of the BasicTermStatsLexiconEntry.

Parameters:
_TF -
_n_t -
_termId -
Method Detail

getDocumentFrequency

public int getDocumentFrequency()
The number of documents that the entry (term) occurred in


setDocumentFrequency

public void setDocumentFrequency(int _n_t)
Sets the document frequency


getFrequency

public int getFrequency()
The frequency (total number of occurrences) of the entry (term).


setFrequency

public void setFrequency(int _TF)
Sets the frequency for this term


getTermId

public int getTermId()
The id of the term


setTermId

public void setTermId(int _termId)
Set the term ID

Specified by:
setTermId in class LexiconEntry

setAll

public void setAll(int _TF,
                   int _n_t,
                   int _termId)
Sets the term frequency, document frequency and term id for this term


getNumberOfEntries

public int getNumberOfEntries()
Returns number of "things" that this pointer refers to


getOffsetBits

public byte getOffsetBits()
Get the number of bits for the offset


getOffset

public long getOffset()
Get the offset (bytes)


setOffset

public void setOffset(long bytes,
                      byte bits)
Set the offset in terms of bits and bytes


setBitIndexPointer

public void setBitIndexPointer(BitIndexPointer pointer)
Sets the bit index pointer to this LexiconEntry


setOffset

public void setOffset(BitFilePosition pos)
Sets the offset using a BitFilePosition


readFields

public void readFields(java.io.DataInput in)
                throws java.io.IOException

Throws:
java.io.IOException

write

public void write(java.io.DataOutput out)
           throws java.io.IOException

Throws:
java.io.IOException

add

public void add(EntryStatistics le)
Increment the statistics of this object by that of another


subtract

public void subtract(EntryStatistics le)
Decrement the statistics of this object by that of another


setNumberOfEntries

public void setNumberOfEntries(int n)
Set the number of "things that the pointer refers to


pointerToString

public java.lang.String pointerToString()
Returns a textual representation of the pointer alone


setPointer

public void setPointer(Pointer p)
Sets the pointer within this object to that represented by the specified pointer

Parameters:
p - other pointer to update the pointer in this object

setStatistics

public void setStatistics(int _n_t,
                          int _TF)
Description copied from class: LexiconEntry
Set the document frequency and term frequency

Specified by:
setStatistics in class LexiconEntry


Terrier 3.5. Copyright © 2004-2011 University of Glasgow