no.sesat.search.query.token
Interface TokenEvaluationEngine

All Known Implementing Classes:
DeadTokenEvaluationEngineImpl, TokenEvaluationEngineImpl

public interface TokenEvaluationEngine

TokenEvaluationEngine contains state as to what is the current term being tokenised, and the term's sets of known and possible predicates. These sets can be in building process, and provide performance improvement by not having to evaluate the token twice. A TokenEvaluationEngine also provides knowledge about which implementation of TokenEvaluator that can handle a particular token TokenPredicate.

Version:
$Revision: 7225 $

Nested Class Summary
static interface TokenEvaluationEngine.Context
           
static interface TokenEvaluationEngine.State
          Holder for evaluation state during the engine's evaluation.
 
Field Summary
static TokenEvaluator ALWAYS_FALSE_EVALUATOR
          Evaluator that will return false under all circumstances.
static TokenEvaluator ALWAYS_TRUE_EVALUATOR
          Evaluator that will return true under all circumstances.
static TokenEvaluator DEAD_EVALUATOR
          Evaluator that will throws an EvaluationException under all circumstances.
 
Method Summary
 boolean evaluate(TokenPredicate token)
          The real evaluation method all other evaluate...(..) methods will delegate to.
 boolean evaluateClause(TokenPredicate predicate, Clause clause)
          Utility method to perform one-off evaluations on clauses from non RunningQuery threads.
 boolean evaluateQuery(TokenPredicate predicate, Query query)
          Utility method to perform one-off evaluations on queries from non RunningQuery threads.
 boolean evaluateTerm(TokenPredicate predicate, String term)
          Utility method to perform one-off evaluations on terms from non RunningQuery threads.
 TokenEvaluator getEvaluator(TokenPredicate token)
          Find or create the TokenEvaluator that will evaluate if given (Token)Predicate is true.
 String getQueryString()
          The query string we're evaluating.
 Site getSite()
          The site the evaluation's request is against
 TokenEvaluationEngine.State getState()
          Getter for property state.
 void setState(TokenEvaluationEngine.State state)
          Setter for property state.
 

Field Detail

ALWAYS_FALSE_EVALUATOR

static final TokenEvaluator ALWAYS_FALSE_EVALUATOR
Evaluator that will return false under all circumstances.


ALWAYS_TRUE_EVALUATOR

static final TokenEvaluator ALWAYS_TRUE_EVALUATOR
Evaluator that will return true under all circumstances.


DEAD_EVALUATOR

static final TokenEvaluator DEAD_EVALUATOR
Evaluator that will throws an EvaluationException under all circumstances.

Method Detail

getEvaluator

TokenEvaluator getEvaluator(TokenPredicate token)
                            throws EvaluationException
Find or create the TokenEvaluator that will evaluate if given (Token)Predicate is true.

Parameters:
token -
Returns:
Throws:
EvaluationException - if something goes wrong constructing or finding an appropriate evaluator.

getQueryString

String getQueryString()
The query string we're evaluating. May be null if we're only evaluating a term.

Returns:

getSite

Site getSite()
The site the evaluation's request is against

Returns:

evaluate

boolean evaluate(TokenPredicate token)
The real evaluation method all other evaluate...(..) methods will delegate to.

Parameters:
token -
Returns:

evaluateTerm

boolean evaluateTerm(TokenPredicate predicate,
                     String term)
Utility method to perform one-off evaluations on terms from non RunningQuery threads. Typically used by TokenTransformers or performing evaluations on non-clause oriented strings.

Parameters:
predicate -
term -
Returns:

evaluateClause

boolean evaluateClause(TokenPredicate predicate,
                       Clause clause)
Utility method to perform one-off evaluations on clauses from non RunningQuery threads. Typically used by TokenTransformers or performing evaluations on non-clause oriented strings.

Parameters:
predicate -
clause -
Returns:

evaluateQuery

boolean evaluateQuery(TokenPredicate predicate,
                      Query query)
Utility method to perform one-off evaluations on queries from non RunningQuery threads. Typically used by TokenTransformers or performing evaluations on non-clause oriented strings.

Parameters:
predicate -
query -
Returns:

getState

TokenEvaluationEngine.State getState()
Getter for property state.

Returns:
Value of property state.

setState

void setState(TokenEvaluationEngine.State state)
Setter for property state.

Parameters:
state - New value of property state.


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.