/*
 * Created on Nov 24, 2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package jone;

import java.util.Comparator;

/**
 * @author brian
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class AnimalComparator implements Comparator {

	/* (non-Javadoc)
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(Object o1, Object o2) {
		Animal a1 = (Animal) o1;
		Animal a2 = (Animal) o2;
		double f1 = a1.getFitness();
		double f2 = a2.getFitness();
		return (f1 == f2 ? 0 : ((f1 > f2) ? 1 : -1));
	}

}
