// Path: src/udo/storage/Task.java
// public static enum TaskType {DEADLINE, EVENT, TODO};


import java.util.ArrayList;
import edu.emory.mathcs.backport.java.util.Collections;
import udo.storage.Task.TaskType;
package udo.storage;



/**
 * This class processes the task list to determine
 * the occupied time slots and free time slots
 */

//@author A0113038U
public class TimeSlots {
    private static final String CONTENT_FREE_SLOT = "Free slot";

	private ArrayList<Task> occupiedSlots;
	private ArrayList<Task> freeSlots;
	
	public TimeSlots(){
		occupiedSlots = new ArrayList<Task>();
		freeSlots = new ArrayList<Task>();
	}
	
	public TimeSlots(ArrayList<Task> taskList){
		occupiedSlots = new ArrayList<Task>();
		freeSlots = new ArrayList<Task>();
		
		addEventTasks(taskList);
		
		Collections.sort(occupiedSlots, new StartTimeComparator());
		
		mergeSlots();
		setFreeSlots();
	}

	private void addEventTasks(ArrayList<Task> taskList) {
		for (int i = 0; i < taskList.size(); i++){
// Path: src/udo/storage/Task.java
// public static enum TaskType {DEADLINE, EVENT, TODO};


// Path: src/udo/storage/TimeSlots.java
import java.util.ArrayList;
import edu.emory.mathcs.backport.java.util.Collections;
import udo.storage.Task.TaskType;

package udo.storage;



/**
 * This class processes the task list to determine
 * the occupied time slots and free time slots
 */

//@author A0113038U
public class TimeSlots {
    private static final String CONTENT_FREE_SLOT = "Free slot";

	private ArrayList<Task> occupiedSlots;
	private ArrayList<Task> freeSlots;
	
	public TimeSlots(){
		occupiedSlots = new ArrayList<Task>();
		freeSlots = new ArrayList<Task>();
	}
	
	public TimeSlots(ArrayList<Task> taskList){
		occupiedSlots = new ArrayList<Task>();
		freeSlots = new ArrayList<Task>();
		
		addEventTasks(taskList);
		
		Collections.sort(occupiedSlots, new StartTimeComparator());
		
		mergeSlots();
		setFreeSlots();
	}

	private void addEventTasks(ArrayList<Task> taskList) {
		for (int i = 0; i < taskList.size(); i++){
			if (taskList.get(i).getTaskType() == TaskType.EVENT){