lempinen.neatseeker.core
Class AbstractWeighter

java.lang.Object
  |
  +--lempinen.neatseeker.core.AbstractWeighter
All Implemented Interfaces:
java.util.Comparator, Weighter
Direct Known Subclasses:
HitCountWeighter, TfIdfWeighter

public abstract class AbstractWeighter
extends java.lang.Object
implements Weighter

Provides an abstract implementation of a Weighter.

Version:
$Id: AbstractWeighter.java,v 1.3 2000/09/27 17:01:25 lempinen Exp $
Author:
Sami Lempinen

Field Summary
protected  long documentCount
          The total document count
protected  Repository repository
          The repository object.
protected  int resultCount
          The total number of documents returned by a particular query.
protected  long wordCount
          The total word count
 
Constructor Summary
AbstractWeighter()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two Pointers for relevance.
 void init(Repository r, Statistics s)
          Initialises the Weighter with the given Repository and given Statistics.
 void setResultCount(int c)
          Sets the number of results returned by a query.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 
Methods inherited from interface lempinen.neatseeker.core.Weighter
calculateWeight, toString
 
Methods inherited from interface java.util.Comparator
equals
 

Field Detail

documentCount

protected long documentCount
The total document count

wordCount

protected long wordCount
The total word count

resultCount

protected int resultCount
The total number of documents returned by a particular query.

repository

protected Repository repository
The repository object.
Constructor Detail

AbstractWeighter

public AbstractWeighter()
Method Detail

init

public void init(Repository r,
                 Statistics s)
Description copied from interface: Weighter
Initialises the Weighter with the given Repository and given Statistics.
Specified by:
init in interface Weighter

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Description copied from interface: Weighter
Compares two Pointers for relevance.

Implemeting classes should throw a RuntimeException if the object are not members of the Pointer class.

Specified by:
compare in interface Weighter

setResultCount

public void setResultCount(int c)
Description copied from interface: Weighter
Sets the number of results returned by a query.
Specified by:
setResultCount in interface Weighter