org.lcsim.emcluster
Class EMClusterESort

java.lang.Object
  extended byorg.lcsim.emcluster.EMClusterESort
All Implemented Interfaces:
java.util.Comparator

public class EMClusterESort
extends java.lang.Object
implements java.util.Comparator

A Comparator for sorting EMClusters

Author:
Norman A. Graf

Constructor Summary
EMClusterESort()
           
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          The compare function used for sorting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

EMClusterESort

public EMClusterESort()
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
The compare function used for sorting. Comparison is done on cluster energy.

Specified by:
compare in interface java.util.Comparator
Parameters:
obj1 - EMCluster1
obj2 - EMCluster2
Returns:
  1. -1 if EMCluster1 > EMCluster2
  2. 0 if EMCluster1 = EMCluster2
  3. 1 if EMCluster1 < EMCluster2