no.sesat.search.query.finder
Class Counter

java.lang.Object
  extended by no.sesat.commons.visitor.AbstractReflectionVisitor
      extended by no.sesat.search.query.finder.Counter
All Implemented Interfaces:
Serializable, no.sesat.commons.visitor.Visitor

public final class Counter
extends no.sesat.commons.visitor.AbstractReflectionVisitor
implements Serializable

Simple visitor used to count the number of leaves under a given clause.

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

Field Summary
 
Fields inherited from class no.sesat.commons.visitor.AbstractReflectionVisitor
VISIT_METHOD_IMPL
 
Constructor Summary
Counter()
           
 
Method Summary
 int getTermCount(Clause root)
          Get the count of leaves under this clause.
protected  void visitImpl(BinaryClause clause)
           
protected  void visitImpl(LeafClause clause)
           
protected  void visitImpl(UnaryClause clause)
           
protected  void visitImpl(XorClause clause)
           
 
Methods inherited from class no.sesat.commons.visitor.AbstractReflectionVisitor
visit, visitImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Counter

public Counter()
Method Detail

getTermCount

public int getTermCount(Clause root)
Get the count of leaves under this clause. Subsequent calls with the same argument will return a cached result.

Parameters:
root - the clause to count leaves within
Returns:
the number of LeafClauses found under the root clause.

visitImpl

protected void visitImpl(UnaryClause clause)
Parameters:
clause -

visitImpl

protected void visitImpl(XorClause clause)
Parameters:
clause -

visitImpl

protected void visitImpl(BinaryClause clause)
Parameters:
clause -

visitImpl

protected void visitImpl(LeafClause clause)
Parameters:
clause -


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