com.sun.labs.minion.indexer.entry
Class BaseEntry

java.lang.Object
  extended by com.sun.labs.minion.indexer.entry.BaseEntry
All Implemented Interfaces:
Entry, IndexEntry, QueryEntry, java.lang.Comparable
Direct Known Subclasses:
CasedEntry, SinglePostingsEntry, TermStatsEntry

public abstract class BaseEntry
extends java.lang.Object
implements IndexEntry, QueryEntry

An abstract base class for all entry types. This supplies the elements common to all entries, namely an ID and a name. The class used for naming entries must implement Comparable so that entries can be sorted by name when dictionaries are dumped to disk.


Field Summary
protected  Dictionary dict
          The dictionary that this entry was drawn from.
protected  int id
          The ID of this entry.
protected  java.lang.Object name
          The name of this entry.
protected  PostingsInput[] postIn
          The input channels that are associated with the postings for this entry.
 
Constructor Summary
BaseEntry()
          Creates a base entry with no name.
BaseEntry(java.lang.Object name)
          Creates an entry with a given name.
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares two entries by the order of their names.
 int getID()
          Gets the ID associated with this entry.
 java.lang.Object getName()
          Gets the name of this entry
 Partition getPartition()
          Gets the partition from which this entry was drawn.
 void setDictionary(Dictionary dict)
          Sets the dictionary that this entry was drawn from.
 void setID(int id)
          Sets the ID associated with this entry.
 void setName(java.lang.Object name)
          Sets the name of this entry.
 void setPostingsInput(PostingsInput[] postIn)
          Sets the channels that will be used to read postings for this entry.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.labs.minion.indexer.entry.IndexEntry
add, append, encodePostingsInfo, writePostings
 
Methods inherited from interface com.sun.labs.minion.indexer.entry.QueryEntry
decodePostingsInfo, hasFieldInformation, hasPositionInformation, iterator, readPostings
 
Methods inherited from interface com.sun.labs.minion.indexer.entry.Entry
getEntry, getEntry, getMaxFDT, getN, getNumChannels, getTotalOccurrences
 

Field Detail

id

protected int id
The ID of this entry.


name

protected java.lang.Object name
The name of this entry. The class used for naming entries must implement Comparable so that entries can be sorted by name when dictionaries are dumped to disk.


postIn

protected PostingsInput[] postIn
The input channels that are associated with the postings for this entry.


dict

protected Dictionary dict
The dictionary that this entry was drawn from.

Constructor Detail

BaseEntry

public BaseEntry()
Creates a base entry with no name.


BaseEntry

public BaseEntry(java.lang.Object name)
Creates an entry with a given name.

Parameters:
name - the name of the entry
Method Detail

getName

public java.lang.Object getName()
Gets the name of this entry

Specified by:
getName in interface Entry
Returns:
The name of this entry.

setName

public void setName(java.lang.Object name)
Sets the name of this entry.

Specified by:
setName in interface Entry
Specified by:
setName in interface IndexEntry
Parameters:
name - The name that we wish the entry to have.

getID

public int getID()
Gets the ID associated with this entry.

Specified by:
getID in interface Entry

setID

public void setID(int id)
Sets the ID associated with this entry.

Specified by:
setID in interface Entry
Specified by:
setID in interface IndexEntry
Parameters:
id - The id to use for this entry.

compareTo

public int compareTo(java.lang.Object o)
Compares two entries by the order of their names.

Specified by:
compareTo in interface java.lang.Comparable

setPostingsInput

public void setPostingsInput(PostingsInput[] postIn)
Sets the channels that will be used to read postings for this entry. This allows us to use different channel implementation strategies at different times.

Specified by:
setPostingsInput in interface QueryEntry
Parameters:
postIn - The inputs from which the postings data can be read.

setDictionary

public void setDictionary(Dictionary dict)
Sets the dictionary that this entry was drawn from.

Specified by:
setDictionary in interface Entry

getPartition

public Partition getPartition()
Gets the partition from which this entry was drawn.

Specified by:
getPartition in interface Entry

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object