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 implementsPointer
andEntryStatistics
.- 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 boolean
equals(java.lang.Object obj)
Does this refer to the same termint
getNumberOfEntries()
Pointer implementation: how many entries in the inverted index.EntryStatistics
getWritableEntryStatistics()
Get a writable copy of the EntryStatistics.int
hashCode()
hash this object based on termidjava.lang.String
pointerToString()
Returns a textual representation of the pointer alonevoid
setNumberOfEntries(int n)
Update the number of entries in the pointervoid
setPointer(Pointer p)
Update the pointerabstract void
setStatistics(int n_t, int TF)
Update the document frequency and term frequencyabstract void
setTermId(int newTermId)
Set the term ID, the integer representation of the term in the index, e.g.java.lang.String
toString()
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:
toString
in 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:
getNumberOfEntries
in 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:
setNumberOfEntries
in interfacePointer
- Parameters:
n
- the number of "things" that the pointer refers to.
-
pointerToString
public java.lang.String pointerToString()
Description copied from interface:Pointer
Returns a textual representation of the pointer alone- Specified by:
pointerToString
in interfacePointer
-
setPointer
public void setPointer(Pointer p)
Update the pointer- Specified by:
setPointer
in 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:
getWritableEntryStatistics
in 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
hash this object based on termid- Overrides:
hashCode
in classjava.lang.Object
-
-