Mercurial > hg > LGServices
diff src/main/java/de/mpiwg/web/search/SortSectionByVolume.java @ 0:3e62083dbcbf
First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
author | "jurzua <jurzua@mpiwg-berlin.mpg.de>" |
---|---|
date | Thu, 23 Apr 2015 15:46:01 +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/search/SortSectionByVolume.java Thu Apr 23 15:46:01 2015 +0200 @@ -0,0 +1,15 @@ +package de.mpiwg.web.search; + +import java.util.Comparator; + +import de.mpiwg.gazetteer.db.DBSection; + +public class SortSectionByVolume implements Comparator<DBSection>{ + + public int compare(DBSection o1, DBSection o2) { + if(o1.getBook() == null || o2.getBook() == null){ + return o1.getName().compareTo(o2.getName()); + } + return o1.getBook().getVolume().compareTo(o2.getBook().getVolume()); + } +}