anl.aida.algo
Class ClustersBuilder.DefClusters<T>

java.lang.Object
  extended by anl.aida.algo.ClustersBuilder.DefClusters<T>
All Implemented Interfaces:
Clusters<T>
Enclosing class:
ClustersBuilder<T>

private static class ClustersBuilder.DefClusters<T>
extends java.lang.Object
implements Clusters<T>


Field Summary
private  java.util.List<SimilarityCluster<T>> clusters
           
private  java.util.Map<T,float[]> itemScores
           
 
Constructor Summary
private ClustersBuilder.DefClusters()
           
 
Method Summary
 java.lang.Iterable<? extends Cluster<T>> clusters()
          Gets an iterable over all the Clusters contained by this collection.
 Cluster<T> getCluster(int index)
          Gets the cluster at the specified index.
 float getScore(T item, int clusterIndex)
          Gets the similarity score of the specified item with the specified cluster centriod.
 int itemCount()
          Gets the total number of clustered items.
 java.lang.Iterable<T> items()
          Gets an iterable over all the clustered items in this collection.
 int size()
          Gets the number of clusters in this collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clusters

private java.util.List<SimilarityCluster<T>> clusters

itemScores

private java.util.Map<T,float[]> itemScores
Constructor Detail

ClustersBuilder.DefClusters

private ClustersBuilder.DefClusters()
Method Detail

getScore

public float getScore(T item,
                      int clusterIndex)
Gets the similarity score of the specified item with the specified cluster centriod.

Specified by:
getScore in interface Clusters<T>
Parameters:
item - the item whose score we want
clusterIndex - the index of the cluster containing the relevant centroid
Returns:
the similarity score of the specified item with the specified cluster centriod.

size

public int size()
Gets the number of clusters in this collection.

Specified by:
size in interface Clusters<T>
Returns:
the number of clusters in this collection.

itemCount

public int itemCount()
Gets the total number of clustered items.

Specified by:
itemCount in interface Clusters<T>
Returns:
the total number of clustered items.

items

public java.lang.Iterable<T> items()
Gets an iterable over all the clustered items in this collection. Each item is contained by one or more clusters.

Specified by:
items in interface Clusters<T>
Returns:
an iterable over all the clustered items in this collection.

clusters

public java.lang.Iterable<? extends Cluster<T>> clusters()
Gets an iterable over all the Clusters contained by this collection.

Specified by:
clusters in interface Clusters<T>
Returns:
an iterable over all the Clusters contained by this collection.

getCluster

public Cluster<T> getCluster(int index)
Gets the cluster at the specified index.

Specified by:
getCluster in interface Clusters<T>
Parameters:
index - the index of the cluster
Returns:
the cluster at the specified index.