net.sourceforge.olduvai.treejuxtaposer.drawer
Class LeafComparator

java.lang.Object
  extended by net.sourceforge.olduvai.treejuxtaposer.drawer.LeafComparator
All Implemented Interfaces:
java.util.Comparator

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

Leaf comparator, compares pair of leaves by leaf index values.

Author:
Tamara

Constructor Summary
LeafComparator()
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Subtract o2.leafindex from o1.leafindex to get comparator value that is negative (o1 < o2), positive (o2 < o1) or zero (equal)
 
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

LeafComparator

public LeafComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Subtract o2.leafindex from o1.leafindex to get comparator value that is negative (o1 < o2), positive (o2 < o1) or zero (equal)

Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - first leaf
o2 - second leaf