diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/fullTextSearch/SortFullTextSearchFileByLastChanged.java	Wed Aug 10 13:00:19 2016 +0200
@@ -0,0 +1,17 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.bo.LGFullTextSearchFile;
+
+
+public class SortFullTextSearchFileByLastChanged implements Comparator<LGFullTextSearchFile>{
+	
+	public int compare(LGFullTextSearchFile o1, LGFullTextSearchFile o2) {
+		
+		if(o1.getLastChangeDate() == null || o2.getLastChangeDate() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getLastChangeDate().compareTo(o2.getLastChangeDate());
+	}
+}