lempinen.neatseeker.core
Class AbstractIndexer

java.lang.Object
  |
  +--lempinen.neatseeker.core.AbstractIndexer
All Implemented Interfaces:
Indexer
Direct Known Subclasses:
HTMLIndexer

public abstract class AbstractIndexer
extends java.lang.Object
implements Indexer

An abstract class for building NeatSeeker indexers.

This class works together with a Collector to index a set of URLs (local or networked). The start method starts the collection process, effectively passing the control of the execution to the Collector partner. The Collector calls back the process for every URL to index.

Version:
$Id: AbstractIndexer.java,v 1.8 2000/10/05 16:51:39 lempinen Exp $

Field Summary
protected  java.io.ByteArrayOutputStream cache
          The internal cache for holding the data to be indexed.
protected  Collector collector
          The Collector partner.
protected  Configuration conf
          The configuration object.
protected  boolean lowerCase
          Lowercase indexing on/off.
protected  Repository repository
          The repository object.
protected  Statistics statistics
          The Statistics object for storing metainformation about the index.
protected  StopWordList stoplist
          The StopWordList object
 
Constructor Summary
AbstractIndexer()
          Creates an empty Indexer.
AbstractIndexer(Configuration c)
          Creates a new Indexer with the given configuration.
 
Method Summary
 void add(Entry entry)
          Adds an entry in the index, with stopword checking if enabled.
 void createCache(java.io.InputStream in)
          Creates a cache of from an InputStream.
 java.io.InputStream getCache()
          Returns the cache as an InputStream.
 Collector getCollector()
          Gets the Collector partner.
 Configuration getConfiguration()
          Returns the Configuration used by this Indexer.
 Repository getRepository()
          Returns the Repository used by this Indexer.
 void init(Configuration c)
          Initialises the Indexer if the empty constructor was used.
 void setCollector(Collector coll)
          Sets the Collector partner.
 void setConfiguration(Configuration c)
          Sets the Configuration used by this Indexer.
 void start()
          Starts the indexing process.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface lempinen.neatseeker.core.Indexer
process
 

Field Detail

repository

protected Repository repository
The repository object.

conf

protected Configuration conf
The configuration object.

collector

protected Collector collector
The Collector partner.

statistics

protected Statistics statistics
The Statistics object for storing metainformation about the index.

lowerCase

protected boolean lowerCase
Lowercase indexing on/off.

stoplist

protected StopWordList stoplist
The StopWordList object

cache

protected java.io.ByteArrayOutputStream cache
The internal cache for holding the data to be indexed.
Constructor Detail

AbstractIndexer

public AbstractIndexer()
Creates an empty Indexer.

AbstractIndexer

public AbstractIndexer(Configuration c)
                throws java.io.IOException
Creates a new Indexer with the given configuration.
Method Detail

init

public void init(Configuration c)
          throws java.io.IOException
Initialises the Indexer if the empty constructor was used.
Specified by:
init in interface Indexer

start

public void start()
           throws java.io.IOException
Starts the indexing process.
Specified by:
start in interface Indexer

createCache

public void createCache(java.io.InputStream in)
                 throws java.io.IOException
Creates a cache of from an InputStream.

getCache

public java.io.InputStream getCache()
Returns the cache as an InputStream.

setCollector

public void setCollector(Collector coll)
Description copied from interface: Indexer
Sets the Collector partner.
Specified by:
setCollector in interface Indexer

getCollector

public Collector getCollector()
Description copied from interface: Indexer
Gets the Collector partner.
Specified by:
getCollector in interface Indexer

setConfiguration

public void setConfiguration(Configuration c)
Description copied from interface: Indexer
Sets the Configuration used by this Indexer.
Specified by:
setConfiguration in interface Indexer

getConfiguration

public Configuration getConfiguration()
Description copied from interface: Indexer
Returns the Configuration used by this Indexer.
Specified by:
getConfiguration in interface Indexer

getRepository

public Repository getRepository()
Description copied from interface: Indexer
Returns the Repository used by this Indexer.
Specified by:
getRepository in interface Indexer

add

public void add(Entry entry)
Adds an entry in the index, with stopword checking if enabled.
Specified by:
add in interface Indexer