org.jbox.indexer
Class AbstractIndexWriter

java.lang.Object
  extended by org.jbox.indexer.AbstractIndexWriter
All Implemented Interfaces:
IndexWriter
Direct Known Subclasses:
IndexWriterWithTFLOC

public abstract class AbstractIndexWriter
extends java.lang.Object
implements IndexWriter

An abstract class defines default behavior of IndexWriter.

Version:
1.0
Author:
YiBin.H

Field Summary
protected  PageHome pageHome
           
protected  WordHome wordHome
           
 
Constructor Summary
AbstractIndexWriter()
           
 
Method Summary
protected abstract  void createIndex(Word w, long pageId)
          Create index of a Word.
 void saveIndex(Page page)
          Write index of words of a Page object to database.
 void setPageHome(PageHome pageHome)
          Set a PageHome for visiting Page table in data base.
 void setWordHome(WordHome wordHome)
          Set a WordHome for visiting Word table in data base.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageHome

protected PageHome pageHome

wordHome

protected WordHome wordHome
Constructor Detail

AbstractIndexWriter

public AbstractIndexWriter()
Method Detail

createIndex

protected abstract void createIndex(Word w,
                                    long pageId)
Create index of a Word.

Parameters:
w - Word object needed to create index.
pageId - id of a page which contains the word.

saveIndex

public void saveIndex(Page page)
Description copied from interface: IndexWriter
Write index of words of a Page object to database.

Specified by:
saveIndex in interface IndexWriter
Parameters:
page - Page object whose words needed to be saved.

setPageHome

public void setPageHome(PageHome pageHome)
Description copied from interface: IndexWriter
Set a PageHome for visiting Page table in data base.

Specified by:
setPageHome in interface IndexWriter
Parameters:
pageHome - DAO of Page.

setWordHome

public void setWordHome(WordHome wordHome)
Description copied from interface: IndexWriter
Set a WordHome for visiting Word table in data base.

Specified by:
setWordHome in interface IndexWriter
Parameters:
wordHome - DAO of Word.