Mercurial > hg > LGServices
comparison src/main/java/de/mpiwg/web/search/SortSectionByAuthor.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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3e62083dbcbf |
---|---|
1 package de.mpiwg.web.search; | |
2 | |
3 import java.util.Comparator; | |
4 | |
5 import de.mpiwg.gazetteer.db.DBSection; | |
6 | |
7 public class SortSectionByAuthor implements Comparator<DBSection>{ | |
8 | |
9 public int compare(DBSection o1, DBSection o2) { | |
10 if(o1.getBook() == null || o2.getBook() == null){ | |
11 return o1.getName().compareTo(o2.getName()); | |
12 } | |
13 return o1.getBook().getAuthor().compareTo(o2.getBook().getAuthor()); | |
14 } | |
15 } |