lempinen.neatseeker.core
Interface Weighter

All Superinterfaces:
java.util.Comparator
All Known Implementing Classes:
AbstractWeighter

public interface Weighter
extends java.util.Comparator

Defines the interface for a NeatSeeker search result weighter.

This interface defines the methods that a search result weighter must implement. Basically, a Weighter implements the Comparable interface and is capable of comparing Pointer objects based on statistical information.

Version:
$Id: Weighter.java,v 1.2 2000/09/27 17:01:25 lempinen Exp $
Author:
Sami Lempinen
See Also:
Comparator

Method Summary
 float calculateWeight(Pointer p)
          Calculates the weight of a Pointer.
 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.
 java.lang.String toString()
          Returns a textual identification of this Weighter.
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

init

public void init(Repository r,
                 Statistics s)
Initialises the Weighter with the given Repository and given Statistics.

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
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 java.util.Comparator

setResultCount

public void setResultCount(int c)
Sets the number of results returned by a query.

calculateWeight

public float calculateWeight(Pointer p)
Calculates the weight of a Pointer.

toString

public java.lang.String toString()
Returns a textual identification of this Weighter.
Overrides:
toString in class java.lang.Object