view 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 source

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());
	}
}