com.google.appengine.api.prospectivesearch.dev
Class QueryEvaluator

java.lang.Object
  extended by com.google.appengine.api.prospectivesearch.dev.QueryEvaluator
All Implemented Interfaces:
com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

public class QueryEvaluator
extends java.lang.Object
implements com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

The QueryEvaluator class performs a full visit of the query tree, dispatching leaf evaluations to the QueryEngine. Fine-grained debugging of query parsing is available at the logging level java.util.logging.Level.FINEST. Not multi-thread safe.


Method Summary
 void visitConjunction(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents a conjunction (logical and) of conditions.
 void visitContains(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents that a field must contain a value.
 void visitDisjunction(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents a disjunction (logical or) of conditions.
 void visitEqual(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents that a field value must be greater than or equal to some specified value.
 void visitFuzzy(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents a text field that is subject to query rewrite.
 void visitGreaterOrEqual(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents an inequality between a field and value.
 void visitGreaterThan(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents that a field value must be greater than some specified value.
 void visitLessOrEqual(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents that a field value must be less than or equal to some specified value.
 void visitLessThan(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents that a field value must be less than some specified value.
 void visitLiteral(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents a text field that must not be altered.
 void visitNegation(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents a negation of conditions.
 void visitOther(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Catch-all method for future type of query nodes.
 void visitRestriction(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents a condition restricted to a named field.
 void visitValue(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker, Tree node, java.util.concurrent.atomic.AtomicBoolean matches)
          Visits a node that represents a constant value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

visitConjunction

public void visitConjunction(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                             Tree node,
                             java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents a conjunction (logical and) of conditions.

Specified by:
visitConjunction in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>
Parameters:
matches - Is set to the conjunction of node's sub-expressions.

visitDisjunction

public void visitDisjunction(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                             Tree node,
                             java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents a disjunction (logical or) of conditions.

Specified by:
visitDisjunction in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>
Parameters:
matches - Is set to the disjunction of node's sub-expressions.

visitNegation

public void visitNegation(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                          Tree node,
                          java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents a negation of conditions.

Specified by:
visitNegation in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>
Parameters:
matches - Is set to the negation of node's sub-expression.

visitRestriction

public void visitRestriction(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                             Tree node,
                             java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents a condition restricted to a named field.

Specified by:
visitRestriction in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>
Parameters:
matches - Is set to the value of node's sub-expression.

visitFuzzy

public void visitFuzzy(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                       Tree node,
                       java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents a text field that is subject to query rewrite.

Specified by:
visitFuzzy in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitLiteral

public void visitLiteral(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                         Tree node,
                         java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents a text field that must not be altered.

Specified by:
visitLiteral in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitLessThan

public void visitLessThan(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                          Tree node,
                          java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents that a field value must be less than some specified value.

Specified by:
visitLessThan in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitLessOrEqual

public void visitLessOrEqual(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                             Tree node,
                             java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents that a field value must be less than or equal to some specified value.

Specified by:
visitLessOrEqual in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitGreaterThan

public void visitGreaterThan(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                             Tree node,
                             java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents that a field value must be greater than some specified value.

Specified by:
visitGreaterThan in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitGreaterOrEqual

public void visitGreaterOrEqual(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                                Tree node,
                                java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents an inequality between a field and value.

Specified by:
visitGreaterOrEqual in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitEqual

public void visitEqual(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                       Tree node,
                       java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents that a field value must be greater than or equal to some specified value.

Specified by:
visitEqual in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitContains

public void visitContains(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                          Tree node,
                          java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents that a field must contain a value.

Specified by:
visitContains in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitValue

public void visitValue(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                       Tree node,
                       java.util.concurrent.atomic.AtomicBoolean matches)
Visits a node that represents a constant value.

Specified by:
visitValue in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>

visitOther

public void visitOther(com.google.appengine.api.search.query.QueryTreeWalker<java.util.concurrent.atomic.AtomicBoolean> walker,
                       Tree node,
                       java.util.concurrent.atomic.AtomicBoolean matches)
Catch-all method for future type of query nodes.

Specified by:
visitOther in interface com.google.appengine.api.search.query.QueryTreeVisitor<java.util.concurrent.atomic.AtomicBoolean>