/*
 * This File is one of the examples from Java Application Development
 * Do not reproduce this code for others or use it in a commercial setting without prior permission from the author.
 */
package products;

import java.util.Comparator;

/**
 *
 * @author Matthew Gregory
 * @website www.matthewgregory-author.com.au
 *
 */
public class CompareByPrice<Item> implements Comparator {
    @Override
    public int compare(Object o1, Object o2) {
        return Double.compare(
                    ((Product) o1).getPrice(),
                    ((Product)o2).getPrice());    }
}
