no.sesat.search.query.parser
Class UrlClauseImpl

java.lang.Object
  extended by no.sesat.search.query.parser.AbstractClause
      extended by no.sesat.search.query.parser.AbstractLeafClause
          extended by no.sesat.search.query.parser.UrlClauseImpl
All Implemented Interfaces:
Serializable, no.sesat.commons.visitor.Visitable, Clause, LeafClause, UrlClause, WordClause

public final class UrlClauseImpl
extends AbstractLeafClause
implements UrlClause

UrlClauseImpl. Contains one http URL. Objects of this class are immutable

Version:
$Id: IntegerClauseImpl.java 2335 2006-02-18 13:45:11Z mickw $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class no.sesat.search.query.parser.AbstractLeafClause
field
 
Fields inherited from class no.sesat.search.query.parser.AbstractClause
DFAULT_REFERENCE_MAP_TYPE, ERR_FAILED_FINDING_OR_USING_CONSTRUCTOR, ERR_MUST_ALWAYS_USE_ARGED_CONSTRUCTOR
 
Constructor Summary
protected UrlClauseImpl(String term, String field, Set<TokenPredicate> knownPredicates, Set<TokenPredicate> possiblePredicates)
          Create clause with the given term, known and possible predicates.
 
Method Summary
static UrlClauseImpl createUrlClause(String term, String field, TokenEvaluationEngine engine)
          Creator method for UrlClauseImpl objects.
 
Methods inherited from class no.sesat.search.query.parser.AbstractLeafClause
createClause, getField, toString
 
Methods inherited from class no.sesat.search.query.parser.AbstractClause
accept, addClauseInUse, findClauseInUse, findPredicates, getKnownPredicates, getPossiblePredicates, getTerm, hashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface no.sesat.search.query.WordClause
getField
 
Methods inherited from interface no.sesat.search.query.Clause
getKnownPredicates, getPossiblePredicates, getTerm
 
Methods inherited from interface no.sesat.commons.visitor.Visitable
accept
 

Constructor Detail

UrlClauseImpl

protected UrlClauseImpl(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 - the field for this clause. May be null.
knownPredicates - the set of known predicates for this clause.
possiblePredicates - the set of possible predicates for this clause.
Method Detail

createUrlClause

public static UrlClauseImpl createUrlClause(String term,
                                            String field,
                                            TokenEvaluationEngine engine)
Creator method for UrlClauseImpl objects. By avoiding the constructors, and assuming all UrlClauseImpl objects are immutable, we can keep track (via a weak reference map) of instances already in use in this JVM and reuse them. The methods also allow a chunk of creation logic for the UrlClauseImpl to be moved out of the QueryParserImpl.jj file to here.

Parameters:
term - the term this clause represents.
field - any field this clause was specified against.
engine - the factory handing out evaluators against TokenPredicates. Also holds state information about the current term/clause we are finding predicates against.
Returns:
returns a UrlClauseImpl matching the term, left and right child clauses. May be either newly created or reused.


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