/* $Id: SortCompellator.java 125 2011-03-09 09:49:51Z ohura $ */
package smart_gs.image_search;

import java.util.Comparator;

import smart_gs.image_search.logical.SearchResult;

public class SortCompellator implements Comparator{
	/**
	 *  scoreが小さい => 上位にくる
	 */
	public int compare(Object o1, Object o2) {
		SearchResult res1 = (SearchResult) o1;
		SearchResult res2 = (SearchResult) o2;
		
		double s1 = res1.getScore();
		double s2 = res2.getScore();
		if(s1 < s2){
			return -1;
		}else if(s1 > s2){
			return 2;
		}
		return 0;
	}
}
