no.sesat.search.query.parser
Class AbstractLeafClause
java.lang.Object
no.sesat.search.query.parser.AbstractClause
no.sesat.search.query.parser.AbstractLeafClause
- All Implemented Interfaces:
- Serializable, no.sesat.commons.visitor.Visitable, Clause, LeafClause
- Direct Known Subclasses:
- EmailClauseImpl, IntegerClauseImpl, NumberGroupClauseImpl, PhoneNumberClauseImpl, PhraseClauseImpl, UrlClauseImpl, WordClauseImpl
public abstract class AbstractLeafClause
- extends AbstractClause
- implements LeafClause
Basic implementation of the LeafClause interface.
Implements ontop of AbstractClause.
Objects of this class are immutable
- Version:
- $Id: AbstractLeafClause.java 7225 2009-04-09 00:32:20Z ssmiweve $
- See Also:
- Serialized Form
|
Method Summary |
static
|
createClause(Class<T> clauseClass,
String term,
String field,
TokenEvaluationEngine engine,
no.sesat.commons.ref.ReferenceMap<String,T> weakCache)
Works off the assumption that LeafClause constructor's have the exact parameter list:
final String term,
final String field,
final Set<Predicate> knownPredicates,
final Set<Predicate> possiblePredicates
Where this is true subclasses are free to use this helper method. |
String |
getField()
Get the field. |
String |
toString()
|
| Methods inherited from interface no.sesat.commons.visitor.Visitable |
accept |
field
protected final String field
- TODO comment me.
AbstractLeafClause
protected AbstractLeafClause(String term,
String field,
Set<TokenPredicate> knownPredicates,
Set<TokenPredicate> possiblePredicates)
- Create clause with the given term, known and possible predicates.
- Parameters:
term - the term (query string) for this clause.field - knownPredicates - the set of known predicates for this clause.possiblePredicates - the set of possible predicates for this clause.
createClause
public static <T extends AbstractLeafClause> T createClause(Class<T> clauseClass,
String term,
String field,
TokenEvaluationEngine engine,
no.sesat.commons.ref.ReferenceMap<String,T> weakCache)
- Works off the assumption that LeafClause constructor's have the exact parameter list:
final String term,
final String field,
final Set<Predicate> knownPredicates,
final Set<Predicate> possiblePredicates
Where this is true subclasses are free to use this helper method.
- Type Parameters:
T - specific type of AbstractLeafClause- Parameters:
clauseClass - the exact subclass of AbstracLeafClause that we are about to create (or find already in use).term - the term the clause we are about to create (or find) will have.field - the field the clause we are about to create (or find) will have.engine - the factory handing out evaluators against TokenPredicates.
Also holds state information about the current term/clause we are finding predicates against.weakCache - the map containing the key to WeakReference (of the Clause) mappings.
- Returns:
- Either a clause already in use that matches this term and field,
or a newly created cluase for this term and field.
getField
public String getField()
- Get the field.
- Specified by:
getField in interface LeafClause
- Returns:
- the field.
toString
public String toString()
- Overrides:
toString in class AbstractClause
Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.