package commonClasses;
import java.util.ArrayList;
import java.util.Collections;

import org.joda.time.DateTime;

import taskDo.Task;

/*
 * @author Paing Zin Oo(Jack)
 */
public class SummaryReport{
	private static String feedBackMsg;
	private static ArrayList<Task> displayList = new ArrayList<Task>();
	private static ArrayList<Integer> imptRowIndexList;
	private static ArrayList<Integer> overdueIndexList;
	private static int rowIndexHighlight = Constants.NOTHING_SELECTED;
	
	public static ArrayList<Integer> getOverdueIndexList() {
		extractOverDueIndex();
		return overdueIndexList;
	}
	
	public static int getRowIndexHighlight() {
		return rowIndexHighlight;
	}
	public static void setRowIndexHighlight(int rowIndexHighlight) {
		SummaryReport.rowIndexHighlight = rowIndexHighlight;
	}
	public static String getFeedBackMsg() {
		return feedBackMsg;
	}
	public static void setFeedBackMsg(String feedBackMsg) {
		SummaryReport.feedBackMsg = feedBackMsg;
	}
	public static ArrayList<Task> getDisplayList() {
		return displayList;
	}
	public static void setDisplayList(ArrayList<Task> displayList) {
		SummaryReport.displayList = displayList;
	}
	
	public static int getTaskId(int id){
		return displayList.get(id-1).getId();
	}
	
	public static void sortByDueDate(){
		Collections.sort(displayList);
	}
	
	
	public static ArrayList<Integer> getImptRowIndexList() {
		extractImptRowIndex();
		return imptRowIndexList;
	}

	private static void extractOverDueIndex(){
		DateTime today = new DateTime();
		overdueIndexList = new ArrayList<Integer>();
		for(int i=0; i < displayList.size(); i++){
			if(displayList.get(i).getDueDate().toLocalDate().isBefore(today.toLocalDate())){
				overdueIndexList.add(i);
			}
		}
	}
	private static void extractImptRowIndex(){
		imptRowIndexList = new ArrayList<Integer>();
		for(int i=0 ; i < displayList.size(); i++){
			if(displayList.get(i).isImportant()){
				imptRowIndexList.add(i);
			}
		}
	}
	
}

@@ -1583,32 +1583,118 @@
 t.size(); i++)%7B%0A
+%09%09%09if(displayList.get(i).getDueDate().toLocalDate().getYear()!=Constants.NILL_YEAR)%7B%0A%09
 %09%09%09if(displayLis
@@ -1765,16 +1765,17 @@
 ))%7B%0A%09%09%09%09
+%09
 overdueI
@@ -1783,37 +1783,47 @@
 dexList.add(i);%0A
+%09
 %09%09%09%7D%0A
+%09%09%09%7D%0A%09%09%09%0A
 %09%09%7D%0A%09%7D%0A%09private 

Remove someday from overdue list