Class LibraryMcs.ClusterEnumerator

java.lang.Object
chemaxon.clustering.libmcs.LibraryMcs.ClusterEnumerator
Enclosing class:
LibraryMcs

public class LibraryMcs.ClusterEnumerator extends Object
The ClusterEnumerator is the right way to obtain results of a LibraryMCS clustering. When clustering terminates, an instance of this class can be retrieved from the LibraryMCS class by the LibraryMcs.getClusterEnumerator(boolean) method. The enumerator then returns each cluster one-by-one starting from the top level of the hierarchy and traversing the dendogram level by level.
Note, that clients are not supposed to instantiate this class directly, instead, the two corresponsing method of the LibraryMCS class have to be applied (see LibraryMcs.getClusterEnumerator(boolean), LibraryMcs.getClusterEnumerator(boolean)).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ClusterEnumerator(chemaxon.clustering.libmcs.MGraph g, boolean leavesOnly)
     
    protected
    ClusterEnumerator(chemaxon.clustering.libmcs.MGraph g, boolean leavesOnly, boolean selectedOnly)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if there is at least one more element in the cluster hierachy that has not yet been listed.
    Returns the next element in the cluster hierarchy that has not yet been processed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ClusterEnumerator

      protected ClusterEnumerator(chemaxon.clustering.libmcs.MGraph g, boolean leavesOnly)
    • ClusterEnumerator

      protected ClusterEnumerator(chemaxon.clustering.libmcs.MGraph g, boolean leavesOnly, boolean selectedOnly)
  • Method Details

    • hasNext

      public boolean hasNext()
      Checks if there is at least one more element in the cluster hierachy that has not yet been listed.
      Returns:
      true if there are more elements
    • next

      public Molecule next()
      Returns the next element in the cluster hierarchy that has not yet been processed. Levels are enumerated top-down manner and one level is enumerated from left to right. All (optional) input fields are stored along with the Molecule returned, and other fields generated by the clustering algorithm are added:
      • RecoveryID unique number of leaf nodes form left to right, starting from one
      • HierarchyID hierarchical index of path from top to leaf
      • Cluster.Member unique cluster id . unique element id in the cluster
      These field help recover the hierarchy in third party and custom applications.
      Returns:
      next Molecule in the hierarchy