no.sesat.search.query.parser
Class AndClauseImpl

java.lang.Object
  extended by no.sesat.search.query.parser.AbstractClause
      extended by no.sesat.search.query.parser.AbstractUnaryClause
          extended by no.sesat.search.query.parser.AbstractBinaryClause
              extended by no.sesat.search.query.parser.AndClauseImpl
All Implemented Interfaces:
Serializable, no.sesat.commons.visitor.Visitable, AndClause, BinaryClause, Clause, UnaryClause

public final class AndClauseImpl
extends AbstractBinaryClause
implements AndClause

The AndClauseImpl represents a joining clause between two terms in the query. For example: "term1 AND term2". Objects of this class are immutable

Version:
$Id: AndClauseImpl.java 7225 2009-04-09 00:32:20Z ssmiweve $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class no.sesat.search.query.parser.AbstractUnaryClause
firstClause
 
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 AndClauseImpl(String term, Clause first, Clause second, Set<TokenPredicate> knownPredicates, Set<TokenPredicate> possiblePredicates)
          Create clause with the given term, field, known and possible predicates.
 
Method Summary
static AndClauseImpl createAndClause(Clause first, Clause second, TokenEvaluationEngine engine)
          Creator method for AndClauseImpl objects.
 
Methods inherited from class no.sesat.search.query.parser.AbstractBinaryClause
getSecondClause, toString
 
Methods inherited from class no.sesat.search.query.parser.AbstractUnaryClause
createClause, getFirstClause
 
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.BinaryClause
getSecondClause
 
Methods inherited from interface no.sesat.search.query.UnaryClause
getFirstClause
 
Methods inherited from interface no.sesat.search.query.Clause
getKnownPredicates, getPossiblePredicates, getTerm
 
Methods inherited from interface no.sesat.commons.visitor.Visitable
accept
 

Constructor Detail

AndClauseImpl

protected AndClauseImpl(String term,
                        Clause first,
                        Clause second,
                        Set<TokenPredicate> knownPredicates,
                        Set<TokenPredicate> possiblePredicates)
Create clause with the given term, field, known and possible predicates.

Parameters:
term - the term (query string) for this clause.
first - the left child clause
second - the right child clause
knownPredicates - the set of known predicates for this clause.
possiblePredicates - the set of possible predicates for this clause.
Method Detail

createAndClause

public static AndClauseImpl createAndClause(Clause first,
                                            Clause second,
                                            TokenEvaluationEngine engine)
Creator method for AndClauseImpl objects. By avoiding the constructors, and assuming all AndClauseImpl 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 AndClauseImpl to be moved out of the QueryParserImpl.jj file to here.

Parameters:
first - the left child clause of the operation clause we are about to create (or find).
second - the right child clause of the operation clause we are about to create (or find).
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 AndAndClauseImplstance matching the term, left and right child clauses. May be either newly created or reused.


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