Mercurial > hg > LGServices
annotate src/main/java/de/mpiwg/web/fullTextSearch/SortFullTextSearchFileByLastChanged.java @ 69:dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 10 Aug 2016 13:00:19 +0200 |
parents | |
children |
rev | line source |
---|---|
69
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 package de.mpiwg.web.fullTextSearch; |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
2 |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
3 import java.util.Comparator; |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
4 |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
5 import de.mpiwg.gazetteer.bo.LGFullTextSearchFile; |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
6 |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
7 |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
8 public class SortFullTextSearchFileByLastChanged implements Comparator<LGFullTextSearchFile>{ |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
9 |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
10 public int compare(LGFullTextSearchFile o1, LGFullTextSearchFile o2) { |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
11 |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
12 if(o1.getLastChangeDate() == null || o2.getLastChangeDate() == null){ |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
13 return o1.getId().compareTo(o2.getId()); |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
14 } |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
15 return o1.getLastChangeDate().compareTo(o2.getLastChangeDate()); |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
16 } |
dd2fcc5f5deb
new: saved table in full text search page: new layout and sorting by time
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
17 } |