annotate src/main/java/de/mpiwg/web/search/SortSectionByBookYear.java @ 105:16a0796e3871 default tip

remove "console.log" from general.js
author Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
date Fri, 29 Sep 2017 16:18:02 +0200
parents d0dcbe8254f5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
1 package de.mpiwg.web.search;
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
2
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
3 import de.mpiwg.gazetteer.db.DBSection;
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
4
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
5 import java.util.Comparator;
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
6
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
7
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
8 public class SortSectionByBookYear implements Comparator<DBSection>{
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
9
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
10 public int compare(DBSection o1, DBSection o2) {
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
11
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
12 if(o1.getBook() == null || o2.getBook() == null){
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
13 return o1.getName().compareTo(o2.getName());
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
14 }
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
15 return o1.getBook().getBookYear().compareTo(o2.getBook().getBookYear());
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
16 }
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
17
d0dcbe8254f5 New Feature: Add book year and edition year in section searching page, also prevent from book not existing exception
Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
parents:
diff changeset
18 }