1 | class StoreEventComparator implements Comparator {↵ | | 1 | class FolderEventComparator implements Comparator {↵
|
|
2 | private static StoreEventComparator instance = new StoreEventComparator();↵ | | 2 | private static FolderEventComparator instance = new FolderEventComparator();↵
|
|
3 | private StoreEventComparator() {↵ | | 3 | private FolderEventComparator() {↵
|
4 | }↵ | | 4 | }↵
|
|
5 | public static StoreEventComparator getInstance() {↵ | | 5 | public static FolderEventComparator getInstance() {↵
|
6 | return instance;↵ | | 6 | return instance;↵
|
7 | }↵ | | 7 | }↵
|
|
8 | /**↵ | | 8 | /**↵
|
9 | * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)↵ | | 9 | * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)↵
|
10 | */↵ | | 10 | */↵
|
11 | public int compare(Object arg0, Object arg1) {↵ | | 11 | public int compare(Object arg0, Object arg1) {↵
|
|
12 | StoreEvent a = (StoreEvent) arg0;↵ | | 12 | FolderEvent a = (FolderEvent) arg0;↵
|
13 | StoreEvent b = (StoreEvent) arg1;↵ | | 13 | FolderEvent b = (FolderEvent) arg1;↵
|
|
14 | return (a.getSource() != b.getSource()) ? 0 : 1;↵ | | 14 | return (a.getSource() != b.getSource()) ? 0 : 1;↵
|
15 | }↵ | | 15 | }↵
|
|
16 | } | | 16 | }
|