Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.data.cluster.naming
Class SimpleEnumeratingScheme

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.data.cluster.naming.SimpleEnumeratingScheme
All Implemented Interfaces:
NamingScheme

public class SimpleEnumeratingScheme
extends Object
implements NamingScheme

Simple enumerating naming scheme. Cluster names are generated as follows: - if the cluster has a name assigned, use it - otherwise use getNameAutomatic() as name, and add an enumeration postfix

Author:
Erich Schubert

Field Summary
private  Clustering<?> clustering
          Clustering this scheme is applied to.
private  Map<String,Integer> namecount
          count how often each name occurred so far.
private  Map<Cluster<?>,String> names
          Assigned cluster names.
private static String nullpostfix
          This is the postfix added to the first cluster, which will be removed when there is only one cluster of this name.
 
Constructor Summary
SimpleEnumeratingScheme(Clustering<?> clustering)
          Constructor.
 
Method Summary
 String getNameFor(Object o)
          Retrieve the cluster name.
private  void updateNames()
          Assign names to each cluster (which doesn't have a name yet)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clustering

private Clustering<?> clustering
Clustering this scheme is applied to.


namecount

private Map<String,Integer> namecount
count how often each name occurred so far.


names

private Map<Cluster<?>,String> names
Assigned cluster names.


nullpostfix

private static final String nullpostfix
This is the postfix added to the first cluster, which will be removed when there is only one cluster of this name.

Constructor Detail

SimpleEnumeratingScheme

public SimpleEnumeratingScheme(Clustering<?> clustering)
Constructor.

Parameters:
clustering - Clustering result to name.
Method Detail

updateNames

private void updateNames()
Assign names to each cluster (which doesn't have a name yet)


getNameFor

public String getNameFor(Object o)
Retrieve the cluster name. When a name has not yet been assigned, call updateNames()

Specified by:
getNameFor in interface NamingScheme
Parameters:
o - cluster to get a name for
Returns:
cluster name

Release 0.3 (2010-03-31_1612)