de.uni_leipzig.cvk.data.cluster
Class ClusterContext

java.lang.Object
  extended by de.uni_leipzig.cvk.data.cluster.ClusterContext

public class ClusterContext
extends java.lang.Object

This class represents the clients context interface and holds a concrete ClusterAlgorithm instance, clients can select, add and use an available cluster algorithm instance. The cluster(String[], double, String, String, String, String) method delegates task to a clusterAlgorithm instance.

 

Field Summary
protected  ClusterAlgorithm clusterAlgorithm
          an instance of the current ClusterAlgorithm
protected  java.util.Map<java.lang.String,ClusterAlgorithm> clusterAlgorithmMap
          all added algorithms
 
Constructor Summary
ClusterContext()
          Initializes the all available algorithms and sets the LogPanelHandler Handler to the Logger.
 
Method Summary
 ClusterAlgorithm addAlgorithm(java.lang.String name, ClusterAlgorithm ca)
          Adds a new instance of a ClusterAlgorithm.
 prefuse.data.Table cluster(java.lang.String[] seeds, double threshold, java.lang.String value_A, java.lang.String value_B, java.lang.String value_C, java.lang.String value_D)
          The cluster method gets the cluster back in a table.
 java.lang.String[] getA()
          Available settings of current cluster algorithm.
 java.lang.String[] getAlgorithmNames()
          Gets all available algorithm names.
 java.lang.String[] getB()
          Available settings of current cluster algorithm.
 java.lang.String[] getC()
          Available settings of current cluster algorithm.
 java.lang.String getCurrentAlgorithmName()
           
 java.lang.String[] getD()
          Available settings of current cluster algorithm.
 void setAlgorithm(java.lang.String name)
          select an available algorithm by the given unique name, to get access of the concrete configurations.
 void setAlgorithm(java.lang.String filename, java.lang.String name)
          Select an available algorithm by the given unique name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clusterAlgorithm

protected ClusterAlgorithm clusterAlgorithm
an instance of the current ClusterAlgorithm


clusterAlgorithmMap

protected java.util.Map<java.lang.String,ClusterAlgorithm> clusterAlgorithmMap
all added algorithms

Constructor Detail

ClusterContext

public ClusterContext()
Initializes the all available algorithms and sets the LogPanelHandler Handler to the Logger.

Method Detail

addAlgorithm

public ClusterAlgorithm addAlgorithm(java.lang.String name,
                                     ClusterAlgorithm ca)
Adds a new instance of a ClusterAlgorithm.

Parameters:
name - the unique name of the algorithm
ca - the algorithm instance
Returns:
the algorithm if success

cluster

public prefuse.data.Table cluster(java.lang.String[] seeds,
                                  double threshold,
                                  java.lang.String value_A,
                                  java.lang.String value_B,
                                  java.lang.String value_C,
                                  java.lang.String value_D)
The cluster method gets the cluster back in a table.

Parameters:
seeds - all selected seeds
threshold - threshold in percent
value_A - value of config_A array
value_B - value of config_B array
value_C - value of config_C array
value_D - value of config_D array
Returns:
table with one or more columns

getA

public java.lang.String[] getA()
Available settings of current cluster algorithm.


getAlgorithmNames

public java.lang.String[] getAlgorithmNames()
Gets all available algorithm names.


getB

public java.lang.String[] getB()
Available settings of current cluster algorithm.


getC

public java.lang.String[] getC()
Available settings of current cluster algorithm.


getCurrentAlgorithmName

public java.lang.String getCurrentAlgorithmName()

getD

public java.lang.String[] getD()
Available settings of current cluster algorithm.


setAlgorithm

public void setAlgorithm(java.lang.String name)
select an available algorithm by the given unique name, to get access of the concrete configurations.


setAlgorithm

public void setAlgorithm(java.lang.String filename,
                         java.lang.String name)
Select an available algorithm by the given unique name. And sets the path to file