no.sesat.search.query.token
Class TokenEvaluationEngineImpl

java.lang.Object
  extended by no.sesat.search.query.token.TokenEvaluationEngineImpl
All Implemented Interfaces:
TokenEvaluationEngine
Direct Known Subclasses:
DeadTokenEvaluationEngineImpl

public class TokenEvaluationEngineImpl
extends Object
implements TokenEvaluationEngine

TokenEvaluateFactory provides knowledge about which implementation of TokenEvaluator that can handle a particular token. This class is not synchronised (Except for the evaluateTerm, evaluateClause, and evaluateQuery methods). Manual synhronisation must be taken when calling operate or setter methods from inside SearchCommand classes.

Version:
$Id: TokenEvaluationEngineImpl.java 7225 2009-04-09 00:32:20Z ssmiweve $

Nested Class Summary
 
Nested classes/interfaces inherited from interface no.sesat.search.query.token.TokenEvaluationEngine
TokenEvaluationEngine.Context, TokenEvaluationEngine.State
 
Field Summary
 
Fields inherited from interface no.sesat.search.query.token.TokenEvaluationEngine
ALWAYS_FALSE_EVALUATOR, ALWAYS_TRUE_EVALUATOR, DEAD_EVALUATOR
 
Constructor Summary
TokenEvaluationEngineImpl(TokenEvaluationEngine.Context cxt)
          Create a new TokenEvaluationEngine.
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenEvaluationEngineImpl

public TokenEvaluationEngineImpl(TokenEvaluationEngine.Context cxt)
Create a new TokenEvaluationEngine.

Parameters:
cxt - context to work within.
Method Detail

getEvaluator

public TokenEvaluator getEvaluator(TokenPredicate token)
                            throws EvaluationException
Description copied from interface: TokenEvaluationEngine
Find or create the TokenEvaluator that will evaluate if given (Token)Predicate is true.

Specified by:
getEvaluator in interface TokenEvaluationEngine
Returns:
Throws:
EvaluationException - if something goes wrong constructing or finding an appropriate evaluator.

getQueryString

public String getQueryString()
Description copied from interface: TokenEvaluationEngine
The query string we're evaluating. May be null if we're only evaluating a term.

Specified by:
getQueryString in interface TokenEvaluationEngine
Returns:

getSite

public Site getSite()
Description copied from interface: TokenEvaluationEngine
The site the evaluation's request is against

Specified by:
getSite in interface TokenEvaluationEngine
Returns:

evaluateTerm

public boolean evaluateTerm(TokenPredicate predicate,
                            String term)
Description copied from interface: TokenEvaluationEngine
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.

Specified by:
evaluateTerm in interface TokenEvaluationEngine
Returns:

evaluateClause

public boolean evaluateClause(TokenPredicate predicate,
                              Clause clause)
Description copied from interface: TokenEvaluationEngine
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.

Specified by:
evaluateClause in interface TokenEvaluationEngine
Returns:

evaluateQuery

public boolean evaluateQuery(TokenPredicate predicate,
                             Query query)
Description copied from interface: TokenEvaluationEngine
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.

Specified by:
evaluateQuery in interface TokenEvaluationEngine
Returns:

evaluate

public boolean evaluate(TokenPredicate token)
Description copied from interface: TokenEvaluationEngine
The real evaluation method all other evaluate...(..) methods will delegate to.

Specified by:
evaluate in interface TokenEvaluationEngine
Returns:

getState

public TokenEvaluationEngine.State getState()
Description copied from interface: TokenEvaluationEngine
Getter for property state.

Specified by:
getState in interface TokenEvaluationEngine
Returns:
Value of property state.

setState

public void setState(TokenEvaluationEngine.State state)
Description copied from interface: TokenEvaluationEngine
Setter for property state.

Specified by:
setState in interface TokenEvaluationEngine
Parameters:
state - New value of property state.


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