org.egothor.core.query
Class Runner

java.lang.Object
  extended by org.egothor.core.query.Runner
Direct Known Subclasses:
AndRunner, NotRunner, OrRunner, PhraseRunner, ProxRunner, TermRunner, VectorRunner

public abstract class Runner
extends java.lang.Object

The Runner object is the gateway between the user making a query and the inverted lists created by the indexer. It has two jobs: to check the validity or the user's query (to check that the query syntax is Egothor compatible), and to calculate the similarity of a document's contents to the user's query.

Author:
Leo Galambos

Constructor Summary
Runner()
           
 
Method Summary
abstract  int evaluate(long uid)
          Return the calculated similarity.
abstract  java.lang.String invalidReason()
          Return an explanation as to why this search is invalid.
 void run()
          Execute this runner.
abstract  int terms()
          Return number of terms evaluated in this runner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Runner

public Runner()
Method Detail

terms

public abstract int terms()
Return number of terms evaluated in this runner.

Returns:
the value

invalidReason

public abstract java.lang.String invalidReason()
Return an explanation as to why this search is invalid.

Returns:
a String containing an explanation (this class returns null )

evaluate

public abstract int evaluate(long uid)
Return the calculated similarity.

Parameters:
uid - the unique ID of the document that is evaluated
Returns:
this implementation returns 0

run

public void run()
Execute this runner. This method does nothing.