Code example for Time

Methods: compare

0
public class TaskComparator implements Comparator<Task> {
 
	@Override 
	public int compare(Task task1, Task task2) {
		if(task1.getIntPriority()==task2.getIntPriority()){
			return Time.compare(task1.getDuedateTime(), task2.getDuedateTime());
		}else{ 
			return task1.getIntPriority()-task2.getIntPriority();
		} 
/*		if(task1.getDuedateTime().equals(task2.getDuedateTime())){ 
			//return task1.getIntPriority().compareTo(task2.getIntPriority()); 
			return task2.getIntPriority() - task1.getIntPriority(); 
		}else{ 
			//return task1.getDueDate().compareTo(task2.getDueDate()); 
			return Time.compare(task1.getDuedateTime(),task2.getDuedateTime()); 
		} 
*/	} 
 
}