com.raritantechnologies.concept.clustering
Class FieldValueClusterer

java.lang.Object
  extended bycom.raritantechnologies.concept.clustering.FieldValueClusterer
All Implemented Interfaces:
IClusterer, IConfigurable

public class FieldValueClusterer
extends java.lang.Object
implements IClusterer

Builds a cluster set based on a set of unique values for a given set of result fields.

XML Configuration Template:
   <Clusterer class="com.raritantechnologies.concept.clustering.FieldValueClusterer"
                 fields="[ comma separated list of fields to build clusters with ]"
                 labelField="[ name of field in cluster result ]" />
 

Developed by Raritan Technologies .

Author:
Ted Sullivan

Constructor Summary
FieldValueClusterer()
           
 
Method Summary
 void dataComplete()
          called by cluster input source when all results to be clustered have been added to the clustering engine.
 QueryResultBean getCluster(java.lang.String clusterName)
          returns the set of clustered result set keys.
 IResultSet getCluster(java.lang.String clusterName, int pageSize, int startRec)
          returns a set of clustered results for a given key.
 java.util.Set getClusterNames()
          returns the names of the clusters created.
 QueryResultBeanSet getClusterSet()
          returns the set of clusters as a QueryResultBeanSet.
 int getClusterSize(java.lang.String clusterName)
          returns the number of results for a given key.
 java.util.List getMatchingClusters(IResult result)
          returns the list of cluster names that match this IResult
 QueryResultBeanSet getSubCluster(java.lang.String clusterName)
           
 java.util.Iterator getSubClusterNames()
          if clusterer supports hierarchical clustering.
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void processResultSet(IResultSet resultSet)
          Uses a QueryResultBean to dedupe and collect results with matching values for the set of cluster Fields.
 void setClusterField(java.lang.String clusterField)
           
 void setClusterFields(java.lang.String[] clusterFields)
           
 void setLabelField(java.lang.String labelField)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldValueClusterer

public FieldValueClusterer()
Method Detail

setClusterFields

public void setClusterFields(java.lang.String[] clusterFields)

setClusterField

public void setClusterField(java.lang.String clusterField)

setLabelField

public void setLabelField(java.lang.String labelField)

processResultSet

public void processResultSet(IResultSet resultSet)
Uses a QueryResultBean to dedupe and collect results with matching values for the set of cluster Fields.

Specified by:
processResultSet in interface IClusterer

dataComplete

public void dataComplete()
Description copied from interface: IClusterer
called by cluster input source when all results to be clustered have been added to the clustering engine.

Specified by:
dataComplete in interface IClusterer

getClusterNames

public java.util.Set getClusterNames()
returns the names of the clusters created.

Specified by:
getClusterNames in interface IClusterer

getClusterSize

public int getClusterSize(java.lang.String clusterName)
returns the number of results for a given key.

Specified by:
getClusterSize in interface IClusterer

getClusterSet

public QueryResultBeanSet getClusterSet()
returns the set of clusters as a QueryResultBeanSet.

Specified by:
getClusterSet in interface IClusterer

getCluster

public QueryResultBean getCluster(java.lang.String clusterName)
returns the set of clustered result set keys.

Specified by:
getCluster in interface IClusterer

getCluster

public IResultSet getCluster(java.lang.String clusterName,
                             int pageSize,
                             int startRec)
returns a set of clustered results for a given key.

Specified by:
getCluster in interface IClusterer

getSubClusterNames

public java.util.Iterator getSubClusterNames()
Description copied from interface: IClusterer
if clusterer supports hierarchical clustering. Returns names of child cluster sets.

Specified by:
getSubClusterNames in interface IClusterer

getSubCluster

public QueryResultBeanSet getSubCluster(java.lang.String clusterName)
Specified by:
getSubCluster in interface IClusterer

getMatchingClusters

public java.util.List getMatchingClusters(IResult result)
returns the list of cluster names that match this IResult

Specified by:
getMatchingClusters in interface IClusterer

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable