org.egothor.query.runner
Class NotRunner

java.lang.Object
  extended by org.egothor.core.query.Runner
      extended by org.egothor.query.runner.NotRunner
Direct Known Subclasses:
NotRunner

public class NotRunner
extends Runner

This object represents a binary form of a NOT b formula. This Runner is used when the user wished to exclude a term from documents returned as hits. For example, the user might wish to find documents where the search terms BASS but NOT GUITAR are used. The form of this query would be given as:

BASS -GUITAR.

Author:
Leo Galambos

Field Summary
 Runner a
          Description of the Field
 Runner b
          Description of the Field
 
Constructor Summary
NotRunner(Runner a, Runner b)
          Constructor for the NotRunner object.
 
Method Summary
 int evaluate(long uid)
          Return the calculated similarity.
 java.lang.String invalidReason()
          Return an explanation as to why this search is invalid.
 int terms()
          Description of the Method
 
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
 

Field Detail

a

public Runner a
Description of the Field


b

public Runner b
Description of the Field

Constructor Detail

NotRunner

public NotRunner(Runner a,
                 Runner b)
Constructor for the NotRunner object.

Parameters:
a - the Runner for the first term
b - the Runner for the second term
Method Detail

invalidReason

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

Specified by:
invalidReason in class Runner
Returns:
a String containing an explanation

terms

public int terms()
Description of the Method

Specified by:
terms in class Runner
Returns:
Description of the Return Value

evaluate

public int evaluate(long uid)
Return the calculated similarity. Returns 0 when the first argument of formula is not positive or the second one is positive.

Specified by:
evaluate in class Runner
Parameters:
uid - the document searched
Returns:
the similarity