no.sesat.search.query.token
Class JepTokenEvaluator

java.lang.Object
  extended by no.sesat.search.query.token.JepTokenEvaluator
All Implemented Interfaces:
TokenEvaluator

public final class JepTokenEvaluator
extends Object
implements TokenEvaluator

Evaluates whether a term or query forms a mathimatical expression. Immutable

Version:
$Id$

Constructor Summary
JepTokenEvaluator(String query, boolean queryDependant)
          Creates a new instance of JepTokenEvaluator and evaluate the query.
 
Method Summary
 boolean evaluateToken(TokenPredicate token, String term, String query)
          Returns true if the query (or term) satifies a JED expression.
 org.nfunk.jep.type.Complex getComplex(String expression)
           
 Set<String> getMatchValues(TokenPredicate token, String term)
          Each true evaluation may also provide a synonym (or "match value").
 boolean isQueryDependant(TokenPredicate predicate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JepTokenEvaluator

public JepTokenEvaluator(String query,
                         boolean queryDependant)
Creates a new instance of JepTokenEvaluator and evaluate the query.

Parameters:
query - the query evaluation is occuring against.
queryDependant - create a complex for every term or just the query? performance consideration.
Method Detail

getComplex

public org.nfunk.jep.type.Complex getComplex(String expression)

evaluateToken

public boolean evaluateToken(TokenPredicate token,
                             String term,
                             String query)
Returns true if the query (or term) satifies a JED expression.

Specified by:
evaluateToken in interface TokenEvaluator
Parameters:
token - not used by this implementation.
term - the term currently parsing.
query - the query to find matches in. can be null. this indicates we can just use the term.
Returns:
true if any of the patterns matches.

isQueryDependant

public boolean isQueryDependant(TokenPredicate predicate)
Specified by:
isQueryDependant in interface TokenEvaluator
Returns:

getMatchValues

public Set<String> getMatchValues(TokenPredicate token,
                                  String term)
Description copied from interface: TokenEvaluator
Each true evaluation may also provide a synonym (or "match value").

Specified by:
getMatchValues in interface TokenEvaluator
Returns:
a list of Tokens


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