1 package org.paneris.jammyjoes.controller; 2 3 import java.util.Comparator; 4 5 import org.paneris.jammyjoes.model.Product; 6 7 public class SupplierNameSort implements Comparator { 8 public int compare(Object arg0, Object arg1) { 9 Product one = (Product)arg0; 10 Product two = (Product)arg1; 11 return one.getSupplier().getName().compareTo(two.getSupplier().getName()); 12 } 13 14 15 }