info.ephyra.search.searchers
Class Searcher

java.lang.Object
  extended by java.lang.Thread
      extended by info.ephyra.search.searchers.Searcher
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
KnowledgeAnnotator, KnowledgeMiner

public abstract class Searcher
extends java.lang.Thread

A Searcher queries an unstructured or (semi)structured knowledge source and passes the results to the static class Search.

It runs as a separate thread, so several queries can be performed in parallel.

This class extends the class Thread and is abstract.

Version:
2005-11-01
Author:
Nico Schlaefer

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  Query query
          Query that is performed.
protected  Result[] results
          The results found in the knowledge source.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Searcher()
           
 
Method Summary
protected abstract  Result[] doSearch()
          Searches an unstructured or (semi)structured knowledge source and returns an array of search results.
 void run()
          Performs the search and passes the results to the static class Search.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

query

protected Query query
Query that is performed.


results

protected Result[] results
The results found in the knowledge source.

Constructor Detail

Searcher

public Searcher()
Method Detail

doSearch

protected abstract Result[] doSearch()
Searches an unstructured or (semi)structured knowledge source and returns an array of search results.

Returns:
search results or an empty array, if the search failed

run

public void run()
Performs the search and passes the results to the static class Search.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread