Subversion Repositories SmartDukaan

Rev

Rev 8666 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8666 Rev 8667
Line 3... Line 3...
3
import java.util.Comparator;
3
import java.util.Comparator;
4
 
4
 
5
public class SaleReportComparator implements Comparator<ItemSale> {
5
public class SaleReportComparator implements Comparator<ItemSale> {
6
 
6
 
7
		public int compare(ItemSale  o1, ItemSale o2) {
7
		public int compare(ItemSale  o1, ItemSale o2) {
8
			System.out.println("Item 1 " + o1.getItem_id() + "Item 2 " + o2.getItem_id());
8
			System.out.println("Item 1 " + o1.getItem_id() + "Product Group " + o1.getProductGroup());
-
 
9
		    System.out.println("Item 2 " + o2.getItem_id() + "Product Group " + o2.getProductGroup());
9
			if (o1.getProductGroup().compareTo(o2.getProductGroup()) > 0) {
10
			if (o1.getProductGroup().compareTo(o2.getProductGroup()) > 0) {
10
				return -1;
11
				return -1;
11
			} else if (o1.getProductGroup().compareTo(o2.getProductGroup()) < 0) {
12
			} else if (o1.getProductGroup().compareTo(o2.getProductGroup()) < 0) {
12
				return 1;
13
				return 1;
13
			}
14
			}