Rev 8666 |
Go to most recent revision |
Details |
Compare with Previous |
Last modification |
View Log
| RSS feed
| Rev |
Author |
Line No. |
Line |
| 8664 |
vikram.rag |
1 |
package com.amazonaws.mws.samples;
|
|
|
2 |
|
|
|
3 |
import java.util.Comparator;
|
|
|
4 |
|
|
|
5 |
public class SaleReportComparator implements Comparator<ItemSale> {
|
|
|
6 |
|
|
|
7 |
public int compare(ItemSale o1, ItemSale o2) {
|
| 8667 |
vikram.rag |
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());
|
| 8664 |
vikram.rag |
10 |
if (o1.getProductGroup().compareTo(o2.getProductGroup()) > 0) {
|
|
|
11 |
return -1;
|
|
|
12 |
} else if (o1.getProductGroup().compareTo(o2.getProductGroup()) < 0) {
|
|
|
13 |
return 1;
|
|
|
14 |
}
|
|
|
15 |
return 0;
|
|
|
16 |
}
|
|
|
17 |
}
|
|
|
18 |
|