/*
  This library is part of the book: 
  Generative Gestaltung, ISBN: 978-3-87439-759-9
  First Edition, Hermann Schmidt, Mainz, 2009
  Copyright (c) 2009 Hartmut Bohnacker, Benedikt Gross, Julia Laub, Claudius Lazzeroni

  http://www.generative-gestaltung.de

  This library is free software; you can redistribute it and/or modify it under the terms 
  of the GNU Lesser General Public License as published by the Free Software Foundation; 
  either version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
  See the GNU Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public License along with this 
  library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 
  Boston, MA 02110, USA
*/

package generativedesign;

import java.util.Comparator;
import processing.core.PApplet;

class yComperator extends PApplet implements Comparator<Object> {
	private static final long serialVersionUID = 1L;

	public int compare(Object arg0, Object arg1) {
		ColorObject val0 = (ColorObject) arg0;
		ColorObject val1 = (ColorObject) arg1;
		if (val0.y < val1.y)
			return 1;
		else if (val0.y == val1.y)
			return 0;
		else
			return -1;
	}
}