Class 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 Detail

      • ClusterEnumerator

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

        protected ClusterEnumerator​(chemaxon.clustering.MGraph g,
                                    boolean leavesOnly,
                                    boolean selectedOnly)
    • Method Detail

      • 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