no.sesat.search.query.parser
Class XorClauseImpl

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.OrClauseImpl
                  extended by no.sesat.search.query.parser.XorClauseImpl
All Implemented Interfaces:
Serializable, no.sesat.commons.visitor.Visitable, BinaryClause, Clause, OrClause, UnaryClause, XorClause

public final class XorClauseImpl
extends OrClauseImpl
implements XorClause

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

Version:
$Id: OrClauseImpl.java 2344 2006-02-20 20:07:12Z mickw $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface no.sesat.search.query.XorClause
XorClause.Hint
 
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 XorClauseImpl(String term, Clause first, Clause second, XorClause.Hint hint, Set<TokenPredicate> knownPredicates, Set<TokenPredicate> possiblePredicates)
          Create the XorClauseImpl with the given term, left and right child clauses, and known and possible predicate sets.
 
Method Summary
static XorClauseImpl createXorClause(Clause first, Clause second, XorClause.Hint hint, TokenEvaluationEngine engine)
          Creator method for XorClauseImpl objects.
 XorClause.Hint getHint()
          The Hint give the neccesary programmatic hint to how the two branches differ.
 
Methods inherited from class no.sesat.search.query.parser.OrClauseImpl
createOrClause
 
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

XorClauseImpl

protected XorClauseImpl(String term,
                        Clause first,
                        Clause second,
                        XorClause.Hint hint,
                        Set<TokenPredicate> knownPredicates,
                        Set<TokenPredicate> possiblePredicates)
Create the XorClauseImpl with the given term, left and right child clauses, and known and possible predicate sets.

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

createXorClause

public static XorClauseImpl createXorClause(Clause first,
                                            Clause second,
                                            XorClause.Hint hint,
                                            TokenEvaluationEngine engine)
Creator method for XorClauseImpl objects. By avoiding the constructors, and assuming all XorClauseImpl 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 XorClauseImpl 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).
hint -
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 XorClauseImpl matching the term, left and right child clauses. May be either newly created or reused.

getHint

public XorClause.Hint getHint()
Description copied from interface: XorClause
The Hint give the neccesary programmatic hint to how the two branches differ.

Specified by:
getHint in interface XorClause


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