Package org.terrier.structures
Class LexiconEntry
- java.lang.Object
-
- org.terrier.structures.LexiconEntry
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.hadoop.io.Writable,EntryStatistics,Pointer
- Direct Known Subclasses:
BasicLexiconEntry,BasicTermStatsLexiconEntry,MemoryLexiconEntry,MultiLexiconEntry,Tr4BasicLexiconEntry,Tr4BasicTermStatsLexiconEntry
public abstract class LexiconEntry extends java.lang.Object implements EntryStatistics, Pointer, org.apache.hadoop.io.Writable
Base class for all LexiconEntry implementations. A LexiconEntry represents the statistics of a term in theLexicon, and a pointer to the term's location in aPostingIndex. For these reasons, this class implementsPointerandEntryStatistics.- Author:
- Craig Macdonald
- See Also:
Lexicon,Pointer,EntryStatistics, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LexiconEntry()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Does this refer to the same termintgetNumberOfEntries()Pointer implementation: how many entries in the inverted index.EntryStatisticsgetWritableEntryStatistics()Get a writable copy of the EntryStatistics.inthashCode()hash this object based on termidjava.lang.StringpointerToString()Returns a textual representation of the pointer alonevoidsetNumberOfEntries(int n)Update the number of entries in the pointervoidsetPointer(Pointer p)Update the pointerabstract voidsetStatistics(int n_t, int TF)Update the document frequency and term frequencyabstract voidsetTermId(int newTermId)Set the term ID, the integer representation of the term in the index, e.g.java.lang.StringtoString()returns a string representation of this lexicon entry-
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, getMaxFrequencyInDocuments, getTermId, setDocumentFrequency, setFrequency, setMaxFrequencyInDocuments, subtract
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
returns a string representation of this lexicon entry- Overrides:
toStringin classjava.lang.Object
-
setTermId
public abstract void setTermId(int newTermId)
Set the term ID, the integer representation of the term in the index, e.g. as used in direct index posting structures.
-
setStatistics
public abstract void setStatistics(int n_t, int TF)Update the document frequency and term frequency
-
getNumberOfEntries
public int getNumberOfEntries()
Pointer implementation: how many entries in the inverted index. Usually the same as getDocumentFrequency().- Specified by:
getNumberOfEntriesin interfacePointer- Returns:
- the number of "things" that this pointer refers to.
-
setNumberOfEntries
public void setNumberOfEntries(int n)
Update the number of entries in the pointer- Specified by:
setNumberOfEntriesin interfacePointer- Parameters:
n- the number of "things" that the pointer refers to.
-
pointerToString
public java.lang.String pointerToString()
Description copied from interface:PointerReturns a textual representation of the pointer alone- Specified by:
pointerToStringin interfacePointer
-
setPointer
public void setPointer(Pointer p)
Update the pointer- Specified by:
setPointerin interfacePointer- Parameters:
p- other pointer to update the pointer in this object.
-
getWritableEntryStatistics
public EntryStatistics getWritableEntryStatistics()
Get a writable copy of the EntryStatistics. Just returns itself.- Specified by:
getWritableEntryStatisticsin interfaceEntryStatistics- Returns:
- an identical entry statistics, but which can be reused.
-
equals
public boolean equals(java.lang.Object obj)
Does this refer to the same term- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
hash this object based on termid- Overrides:
hashCodein classjava.lang.Object
-
-