no.sesat.search.query.analyser
Class Scorer

java.lang.Object
  extended by no.sesat.commons.visitor.AbstractReflectionVisitor
      extended by no.sesat.search.query.analyser.Scorer
All Implemented Interfaces:
no.sesat.commons.visitor.Visitor

public final class Scorer
extends no.sesat.commons.visitor.AbstractReflectionVisitor

Responsible for Visiting the Query and scoring a total according to the rule's predicateScores listed in the context. This class is not thread-safe.

Version:
$Id: Scorer.java 7225 2009-04-09 00:32:20Z ssmiweve $

Nested Class Summary
static interface Scorer.Context
          The contextual dependencies the Scorer requires to calculate a total score for this Query it will visit.
 
Field Summary
 
Fields inherited from class no.sesat.commons.visitor.AbstractReflectionVisitor
VISIT_METHOD_IMPL
 
Constructor Summary
Scorer(Scorer.Context cxt)
          Create the Scorer with the required context.
 
Method Summary
 void addScore(PredicateScore predicateScore)
          A positive match on the PredicateScore increases the score.
 void error(PredicateScore predicateScore)
          An error occurred looking for a match against the PredicateScore.
 int getScore()
          the scoring result.
 void minusScore(PredicateScore predicateScore)
          A negative match on the PredicateScore decreases the score.
 
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

Scorer

public Scorer(Scorer.Context cxt)
Create the Scorer with the required context.

Parameters:
cxt -
Method Detail

getScore

public int getScore()
the scoring result. should not be called before visiting is over.

Returns:
the current score.

addScore

public void addScore(PredicateScore predicateScore)
A positive match on the PredicateScore increases the score. *

Parameters:
predicateScore -

minusScore

public void minusScore(PredicateScore predicateScore)
A negative match on the PredicateScore decreases the score. *

Parameters:
predicateScore -

error

public void error(PredicateScore predicateScore)
An error occurred looking for a match against the PredicateScore. *

Parameters:
predicateScore -


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