no.sesat.search.query.token
Interface TokenPredicate

All Superinterfaces:
org.apache.commons.collections.Predicate, Serializable
All Known Implementing Classes:
AbstractTokenPredicate, Categories, ExactTokenPredicateImpl, TokenPredicateImpl

public interface TokenPredicate
extends org.apache.commons.collections.Predicate, Serializable

A Categorisation of knowledge that attaches itself as meta-data to words and groups of words (clauses) within a query.

Requirement that TokenPredicate, of any implementation, have a unique name.

Implementation of org.apache.commons.collections.Predicate for the terms in the Query. Predicates use TokenEvaluators to prove the Predicate's validity to the Query.

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

Field Summary
static String EXACT_PREFIX
          Exact (^.*$) TokenPredicates are expected to have the following prefix to their names.
 
Method Summary
 boolean evaluate(Object evalFactory)
          Evaluates to true if fastListName occurs in the query.
 TokenPredicate exactPeer()
          A token predicate that requires an exact match against the whole query.
 String name()
          The name of the TokenPredicate.
 

Field Detail

EXACT_PREFIX

static final String EXACT_PREFIX
Exact (^.*$) TokenPredicates are expected to have the following prefix to their names.

See Also:
Constant Field Values
Method Detail

name

String name()
The name of the TokenPredicate. Must be uppercase. Must be unique across all skins.

Returns:
TokenPredicate name.

evaluate

boolean evaluate(Object evalFactory)
Evaluates to true if fastListName occurs in the query. This method uses a TokenEvaluationEngine to get a TokenEvaluator. This method can only be called from the RunningQuery thread, not spawned search commands.

Specified by:
evaluate in interface org.apache.commons.collections.Predicate
Parameters:
evalFactory - The TTokenEvaluationEngineused to get a TokenEvaluator for this fastListName, AND to get the current term in the query being tokenised.
Returns:
true if, according to the TokenEvaluator provided by the TokTokenEvaluationEngineastListName evaluates to true.

exactPeer

TokenPredicate exactPeer()
A token predicate that requires an exact match against the whole query. A exact peer instance must return itself.

Returns:


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