com.sun.labs.minion
Interface ResultsCluster

All Known Implementing Classes:
ResultsClusterImpl

public interface ResultsCluster

A cluster of results from a search engine.


Method Summary
 boolean contains(java.lang.String key)
          Determines whether the document that has the given key is a member of this cluster.
 double distance(java.lang.String key)
          Calculates the distance of the document with the given key from the cluster centroid, giving you an idea of how central it is to the cluster.
 java.util.List<java.lang.String> getDescription(int n)
          Gets a list of strings describing this cluster.
 Result getMostCentralResult()
          Get the result closest to the centroid of this cluster.
 java.lang.String getName()
          Gets any name that might have been assigned to this cluster during the clustering process.
 ResultSet getResults()
          Gets the results that make up this cluster.
 ClusterStatistics getStatistics()
          Gets statistics describing the cluster.
 int size()
          Returns the number of items in this cluser.
 

Method Detail

getDescription

java.util.List<java.lang.String> getDescription(int n)
Gets a list of strings describing this cluster. These strings might be words or phrases from the documents or particular saved field values. The particluar clustering algorithm will decide which strings to use to describe the cluster.

Parameters:
n - the maximum number of strings to return.
Returns:
a list of strings describing the contents of the cluster.

getMostCentralResult

Result getMostCentralResult()
Get the result closest to the centroid of this cluster.

Returns:
the result which is the closest to the centroid of the cluster

getResults

ResultSet getResults()
Gets the results that make up this cluster.

Returns:
the results that make up this cluster.

getName

java.lang.String getName()
Gets any name that might have been assigned to this cluster during the clustering process.

Returns:
any name assigned to this cluster, or null if no name was assigned.

getStatistics

ClusterStatistics getStatistics()
Gets statistics describing the cluster.

Returns:
statistics for this cluster

contains

boolean contains(java.lang.String key)
Determines whether the document that has the given key is a member of this cluster.

Parameters:
key - the key of the document that we want to check
Returns:
true if the document with the given key is a member of this cluster, false otherwise.

distance

double distance(java.lang.String key)
Calculates the distance of the document with the given key from the cluster centroid, giving you an idea of how central it is to the cluster.

Parameters:
key - the key of a document for which we require the distance from the cluster centroid. This document does not need to be a member of this cluster in order to do this computation.
Returns:
the distance from the centroid of this cluster to the document that has the given key

size

int size()
Returns the number of items in this cluser.

Returns:
the number of items in this cluster