org.imemex.queryprocessor.scoring
Class AbstractScoring<E extends IdentifiableResourceView>

java.lang.Object
  extended by org.imemex.queryprocessor.scoring.AbstractScoring<E>
All Implemented Interfaces:
Scoring<E>
Direct Known Subclasses:
DefaultScoring, MemoryLessScoring

public abstract class AbstractScoring<E extends IdentifiableResourceView>
extends java.lang.Object
implements Scoring<E>

Provides an abstract implementation of a scoring scheme.

Author:
marcos

Constructor Summary
AbstractScoring()
          Instantiates a new AbstractScoring
 
Method Summary
 E computeTotalScore(E rv)
          iterate throug all registered rules and compute score
 double getMaxScore()
           
 int getRuleCount()
          get the number of registered rules
 void registerScoringRule(ScoringRule<E> sr)
          register a given ScoringRule
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractScoring

public AbstractScoring()
Instantiates a new AbstractScoring

Method Detail

registerScoringRule

public void registerScoringRule(ScoringRule<E> sr)
Description copied from interface: Scoring
register a given ScoringRule

Specified by:
registerScoringRule in interface Scoring<E extends IdentifiableResourceView>
Parameters:
sr - the ScoringRule to register

computeTotalScore

public E computeTotalScore(E rv)
Description copied from interface: Scoring
iterate throug all registered rules and compute score

Specified by:
computeTotalScore in interface Scoring<E extends IdentifiableResourceView>
Returns:
the scored ResourceViewWrapper instance

getRuleCount

public int getRuleCount()
Description copied from interface: Scoring
get the number of registered rules

Specified by:
getRuleCount in interface Scoring<E extends IdentifiableResourceView>
Returns:
number of registered rules

getMaxScore

public double getMaxScore()
Specified by:
getMaxScore in interface Scoring<E extends IdentifiableResourceView>
Returns:
Returns maximal reachable score if every rule matches perfect.