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

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

public abstract class CasedEntry
extends BaseEntry
implements CasedPostingsEntry

A class for holding cased dictionary entries.


Field Summary
protected  IndexEntry ciEntry
          A reference to the case insensitive postings that are associated with this entry.
protected static java.lang.String logTag
          A tag.
protected  int[] n
          The number of each type of postings.
protected  long[] offset
          The offset of the case sensitive postings.
protected  Postings[] p
          Postings for the case sensitive and case insensitive versions of saved field values.
protected  int[] size
          The size of each kind of postings.
protected  int totalSize
          The total size of the postings.
 
Fields inherited from class com.sun.labs.minion.indexer.entry.BaseEntry
dict, id, name, postIn
 
Constructor Summary
CasedEntry()
          Creates a cased postings entry.
CasedEntry(java.lang.Object name)
          Creates a cased postings entry.
 
Method Summary
 void add(Occurrence o)
          Adds an occurrence to this index entry.
protected  void add(Occurrence o, int pos)
          Adds an occurrence to the postings at a given position.
 void decodePostingsInfo(ReadableBuffer b, int pos)
          Decodes the postings information associated with this entry.
 void encodePostingsInfo(WriteableBuffer b)
          Encodes any information associated with the postings onto the given buffer.
 Entry getCaseInsensitiveEntry()
          Gets the case insensitive entry for this entry.
 Entry getEntry()
          Gets a new entry that contains a copy of the data in the given entry.
 int getNumChannels()
          Returns the number of channels needed to store the postings for this entry type.
protected abstract  void init()
          Initializes the arrays containing postings, sizes, etc.
protected abstract  void initPostings(int pos)
          Initializes postings at a given position in the postings array.
 void setCaseInsensitiveEntry(IndexEntry e)
          Sets the case insensitive entry for this entry.
 
Methods inherited from class com.sun.labs.minion.indexer.entry.BaseEntry
compareTo, getID, getName, getPartition, setDictionary, setID, setName, setPostingsInput, 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.CasedPostingsEntry
addCaseInsensitive, addCaseSensitive, getCaseInsensitivePostings, getCaseSensitivePostings, nameOccurred
 
Methods inherited from interface com.sun.labs.minion.indexer.entry.IndexEntry
append, writePostings
 
Methods inherited from interface com.sun.labs.minion.indexer.entry.QueryEntry
hasFieldInformation, hasPositionInformation, iterator, readPostings
 
Methods inherited from interface com.sun.labs.minion.indexer.entry.Entry
getEntry, getMaxFDT, getN, getTotalOccurrences
 

Field Detail

ciEntry

protected IndexEntry ciEntry
A reference to the case insensitive postings that are associated with this entry.


p

protected Postings[] p
Postings for the case sensitive and case insensitive versions of saved field values.


n

protected int[] n
The number of each type of postings.


size

protected int[] size
The size of each kind of postings.


totalSize

protected int totalSize
The total size of the postings.


offset

protected long[] offset
The offset of the case sensitive postings.


logTag

protected static java.lang.String logTag
A tag.

Constructor Detail

CasedEntry

public CasedEntry()
Creates a cased postings entry.


CasedEntry

public CasedEntry(java.lang.Object name)
Creates a cased postings entry.

Method Detail

init

protected abstract void init()
Initializes the arrays containing postings, sizes, etc.


initPostings

protected abstract void initPostings(int pos)
Initializes postings at a given position in the postings array.


getEntry

public Entry getEntry()
Gets a new entry that contains a copy of the data in the given entry.

Specified by:
getEntry in interface Entry
Returns:
a new entry.

add

public void add(Occurrence o)
Adds an occurrence to this index entry.

Specified by:
add in interface IndexEntry
Parameters:
o - The occurrence to add.

add

protected void add(Occurrence o,
                   int pos)
Adds an occurrence to the postings at a given position.


getNumChannels

public int getNumChannels()
Returns the number of channels needed to store the postings for this entry type.

Specified by:
getNumChannels in interface Entry

encodePostingsInfo

public void encodePostingsInfo(WriteableBuffer b)
Encodes any information associated with the postings onto the given buffer.

Specified by:
encodePostingsInfo in interface IndexEntry
Parameters:
b - The buffer onto which the postings information should be encoded. The buffer will be positioned to the correct spot for the encoding.

decodePostingsInfo

public void decodePostingsInfo(ReadableBuffer b,
                               int pos)
Decodes the postings information associated with this entry.

Specified by:
decodePostingsInfo in interface QueryEntry
Parameters:
b - The buffer containing the encoded postings information.
pos - The position in b where the postings information can be found.

setCaseInsensitiveEntry

public void setCaseInsensitiveEntry(IndexEntry e)
Sets the case insensitive entry for this entry.

Specified by:
setCaseInsensitiveEntry in interface CasedPostingsEntry
Parameters:
e - the case insensitive entry associated with this entry

getCaseInsensitiveEntry

public Entry getCaseInsensitiveEntry()
Gets the case insensitive entry for this entry.

Specified by:
getCaseInsensitiveEntry in interface CasedPostingsEntry
Returns:
the case insensitive entry for this entry