jklustor-all-api-0.0.7-20140619012755 (ChemAxon)


com.chemaxon.clustering.common
Class IDBasedAssignerBuilder

Object
  extended by com.chemaxon.clustering.common.IDBasedAssignerBuilder

@Beta
public class IDBasedAssignerBuilder
extends Object

An ID based cluster level assigner builder.

Please note that the following must be satisfied:

Checking of the above conditions are not enforced during setup.

Please note that this class is marked with Beta annotation, so it can be subject of incompatible changes or removal in later releases.

Author:
Gabor Imre

Nested Class Summary
(package private) static class IDBasedAssignerBuilder.IDBAssignerImpl
          Implementation for level assigner.
 
Constructor Summary
IDBasedAssignerBuilder()
           
 
Method Summary
(package private)  IDBasedAssigner build(IDBasedHierarchy hierarchy)
          Build the assigner.
(package private) static IDBasedAssigner createUnitPathAssigner(IDBasedHierarchy hierarchy)
          Utility method to build a path length assigner based on a hierarchy.
 double getClusterLevel(int clusterID)
          Get the current associated level for a cluster.
 double getLeafLevel(int leafID)
          Get the current associated level for a leaf.
 void setClusterLevel(int clusterID, double level)
          Set the level of a specific cluster.
 void setLeafLevel(int leafID, double level)
          Set the level of a specific leaf node.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDBasedAssignerBuilder

public IDBasedAssignerBuilder()
Method Detail

setClusterLevel

public void setClusterLevel(int clusterID,
                            double level)
Set the level of a specific cluster.

If level information for a specific cluster is already set it will be overwritten. Note that 0 level must be explicitly set for roots when clustering is root aligned.

Parameters:
clusterID - ID of cluster
level - Level to assign

getClusterLevel

public double getClusterLevel(int clusterID)
Get the current associated level for a cluster.

Parameters:
clusterID - ID of a cluster
Returns:
Associated level for the cluster
Throws:
IllegalArgumentException - when no level set for the given cluster

getLeafLevel

public double getLeafLevel(int leafID)
Get the current associated level for a leaf.

Parameters:
leafID - ID of a leaf
Returns:
Associated level of the leaf
Throws:
IllegalArgumentException - when no level set for the given leaf

setLeafLevel

public void setLeafLevel(int leafID,
                         double level)
Set the level of a specific leaf node.

If level information for a specific leaf is already set it will be overwritten. Note that explicitly setting 0 level of leaves for leaf aligned clusterings is not needed. Mixed setting is also possible.

Parameters:
leafID - ID of the leaf
level - Level to assign

build

IDBasedAssigner build(IDBasedHierarchy hierarchy)
Build the assigner.

Note that this method usually invoked by IDBasedHierarchicClusterBuidler.build(com.chemaxon.clustering.common.IDBasedAssignerBuilder).

Parameters:
hierarchy - Associated clustering hierarchy
Returns:
Immutable assigner for the given hierarchy

createUnitPathAssigner

static IDBasedAssigner createUnitPathAssigner(IDBasedHierarchy hierarchy)
Utility method to build a path length assigner based on a hierarchy.

Parameters:
hierarchy - Underlying hierarchy
Returns:
Built unit path assigner

jklustor-all-api-0.0.7-20140619012755 (ChemAxon)