org.terrier.structures
Class LexiconEntry

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

public abstract class LexiconEntry
extends Object
implements EntryStatistics, Pointer, org.apache.hadoop.io.Writable

Represents the statistics of a term in the Lexicon, and a pointer to the term's location in the InvertedIndex. For these reasons, this class implements Pointer and EntryStatistics.

Author:
Craig Macdonald
See Also:
Lexicon, Pointer, EntryStatistics, Serialized Form

Constructor Summary
LexiconEntry()
           
 
Method Summary
 boolean equals(Object obj)
           
 int getNumberOfEntries()
          Returns number of "things" that this pointer refers to
 EntryStatistics getWritableEntryStatistics()
          Get a copy of these entry statistics that can be reused.
 int hashCode()
           
 String pointerToString()
          Returns a textual representation of the pointer alone
 void setNumberOfEntries(int n)
          Set the number of "things that the pointer refers to
 void setPointer(Pointer p)
          Sets the pointer within this object to that represented by the specified pointer
abstract  void setStatistics(int n_t, int TF)
          Set the document frequency and term frequency
abstract  void setTermId(int newTermId)
          Set the term ID
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.terrier.structures.EntryStatistics
add, getDocumentFrequency, getFrequency, getTermId, subtract
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 

Constructor Detail

LexiconEntry

public LexiconEntry()
Method Detail

toString

public String toString()

Overrides:
toString in class Object

setTermId

public abstract void setTermId(int newTermId)
Set the term ID


setStatistics

public abstract void setStatistics(int n_t,
                                   int TF)
Set the document frequency and term frequency


getNumberOfEntries

public int getNumberOfEntries()
Description copied from interface: Pointer
Returns number of "things" that this pointer refers to

Specified by:
getNumberOfEntries in interface Pointer

setNumberOfEntries

public void setNumberOfEntries(int n)
Description copied from interface: Pointer
Set the number of "things that the pointer refers to

Specified by:
setNumberOfEntries in interface Pointer

pointerToString

public String pointerToString()
Description copied from interface: Pointer
Returns a textual representation of the pointer alone

Specified by:
pointerToString in interface Pointer

setPointer

public void setPointer(Pointer p)
Description copied from interface: Pointer
Sets the pointer within this object to that represented by the specified pointer

Specified by:
setPointer in interface Pointer
Parameters:
p - other pointer to update the pointer in this object

getWritableEntryStatistics

public EntryStatistics getWritableEntryStatistics()
Description copied from interface: EntryStatistics
Get a copy of these entry statistics that can be reused.

Specified by:
getWritableEntryStatistics in interface EntryStatistics

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Terrier 3.6. Copyright © 2004-2011 University of Glasgow