com.xinapse.multisliceimage.roi
Class StatsComparator

java.lang.Object
  extended by com.xinapse.multisliceimage.roi.StatsComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<ROI>

public class StatsComparator
extends java.lang.Object
implements java.util.Comparator<ROI>, java.io.Serializable

A Comparator used in sorting operations for ROIs based on their statistics.

See Also:
Serialized Form

Constructor Summary
StatsComparator(StatsType statsType)
          Create a new StatsComparator object, for sorting ROIs using the supplied type of statistic to determine the sort order.
 
Method Summary
 int compare(ROI roi1, ROI roi2)
          Compares the statistics for two ROIs for order.
 
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

StatsComparator

public StatsComparator(StatsType statsType)
Create a new StatsComparator object, for sorting ROIs using the supplied type of statistic to determine the sort order.

Parameters:
statsType - the StatsType on which to sort.
Method Detail

compare

public int compare(ROI roi1,
                   ROI roi2)
Compares the statistics for two ROIs for order. Returns a negative integer, zero, or a positive integer as the statistic for the first ROI is less than, equal to, or greater than the statistic for the second ROI. The statistic to be compared is determined at instantiation of this Comparator.

Specified by:
compare in interface java.util.Comparator<ROI>
Parameters:
roi1 - the first ROI for which to compare statistics.
roi2 - the second ROI for which to compare statistics.
Returns:
a negative integer, zero, or a positive integer as the first ROI's statistic is less than, equal to, or greater than the second.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.