org.ceryle.util.search
Class Finder

java.lang.Object
  extended by org.ceryle.util.search.Finder
Direct Known Subclasses:
FSFinder, XNodeFinder

public abstract class Finder
extends Object

An abstract class to supply search engine support for searching a particular domain of content.

Since:
JDK1.4
Version:
$Id: Finder.java,v 1.6 2007-06-15 12:10:03 altheim Exp $
Author:
Murray Altheim

Field Summary
protected  Indexer m_indexer
           
protected  MessageHandler mh
           
protected  MessageWriter mw
           
protected  ProgressBar progress
           
 
Constructor Summary
Finder(Indexer indexer, MessageHandler msghandler, MessageWriter msgwriter)
          Constructor for a Finder.
 
Method Summary
 Indexer getIndexer()
          Returns the Indexer used by this Finder.
 ProgressBar getProgressBar()
          Returns the optional ProgressBar, or null if it is not set.
 boolean hasProgressBar()
          Returns true if the optional ProgressBar has been set.
abstract  SearchHit[] search(String queryString)
          Searches a given domain using the String queryString, returning an array of SearchHits.
 void setProgressBar(ProgressBar progressBar)
          Sets an optional ProgressBar to indicate process status.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_indexer

protected Indexer m_indexer

progress

protected ProgressBar progress

mw

protected MessageWriter mw

mh

protected MessageHandler mh
Constructor Detail

Finder

public Finder(Indexer indexer,
              MessageHandler msghandler,
              MessageWriter msgwriter)
Constructor for a Finder.

Parameters:
indexer - the indexer used for the search.
msghandler - to process status and other messages.
msgwriter - to receive status and other messages.
Method Detail

search

public abstract SearchHit[] search(String queryString)
Searches a given domain using the String queryString, returning an array of SearchHits. This returns an empty array if the search results are empty rather than a null.

Parameters:
queryString - the query string used for the search.
Returns:
an array of SearchHits corresponding to the matching Documents.

getIndexer

public final Indexer getIndexer()
Returns the Indexer used by this Finder.


hasProgressBar

public final boolean hasProgressBar()
Returns true if the optional ProgressBar has been set.


setProgressBar

public final void setProgressBar(ProgressBar progressBar)
Sets an optional ProgressBar to indicate process status.


getProgressBar

public final ProgressBar getProgressBar()
Returns the optional ProgressBar, or null if it is not set.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.