chemaxon.clustering
Class LibraryMCS.ClusterEnumerator

java.lang.Object
  extended bychemaxon.clustering.LibraryMCS.ClusterEnumerator
Enclosing class:
LibraryMCS

public class LibraryMCS.ClusterEnumerator
extends java.lang.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
protected LibraryMCS.ClusterEnumerator(chemaxon.clustering.MGraph g, boolean leavesOnly)
           
protected LibraryMCS.ClusterEnumerator(chemaxon.clustering.MGraph g, boolean leavesOnly, boolean selectedOnly)
           
 
Method Summary
 boolean hasNext()
          Checks if there is at least one more element in the cluster hierachy that has not yet been listed.
 Molecule next()
          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 Detail

LibraryMCS.ClusterEnumerator

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

LibraryMCS.ClusterEnumerator

protected LibraryMCS.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: These field help recover the hierarchy in third party and custom applications.

Returns:
next Molecule in the hierarchy