org.egothor.query.runner.enhanced
Class AndRunner

java.lang.Object
  extended by org.egothor.core.query.Runner
      extended by org.egothor.query.runner.AndRunner
          extended by org.egothor.query.runner.enhanced.AndRunner

public class AndRunner
extends AndRunner

The AndRunner object represents a binary form of the boolean AND formula. For example, the user may wish to view documents containing the words BASS and GUITAR. The form of this query would be given as:

BASS&&GUITAR.

Author:
Leo Galambos

Field Summary
 
Fields inherited from class org.egothor.query.runner.AndRunner
a, b
 
Constructor Summary
AndRunner(int model, Runner a, Runner b)
          Constructor for the AndRunner object.
 
Method Summary
 int evaluate(long uid)
          Return the calculated similarity between this query and the document with the given unique ID.
 java.lang.String invalidReason()
          Return an explanation as to why this search is invalid.
 
Methods inherited from class org.egothor.query.runner.AndRunner
terms
 
Methods inherited from class org.egothor.core.query.Runner
run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AndRunner

public AndRunner(int model,
                 Runner a,
                 Runner b)
Constructor for the AndRunner object.

Parameters:
model - Description of the Parameter
a - the Runner for the first query
b - the Runner for the second query
Method Detail

invalidReason

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

Overrides:
invalidReason in class AndRunner
Returns:
a String containing an explanation

evaluate

public int evaluate(long uid)
Return the calculated similarity between this query and the document with the given unique ID. When any of the formula variables returns a non-positive value, then the evaluation is 0.

Overrides:
evaluate in class AndRunner
Parameters:
uid - the unique id of the document
Returns:
0 if a variable is less than 0, or an integer resulting from the formula described in the code