package udo.storage;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Task {
	//class defines Task objects
	private String taskType;
	private String content;
	private GregorianCalendar start;
	private GregorianCalendar end;
	private int duration;
	private GregorianCalendar reminder;
	private String label;
	private boolean priority;
	private boolean done;
	
	//constructor
	public Task(String taskType, String content, GregorianCalendar start, GregorianCalendar end, 
			int duration, GregorianCalendar reminder, String label, boolean priority){
		this.taskType = taskType;
		this.content = content;
		this.start = start;
		this.end = end;
		this.duration = duration;
		this.reminder = reminder;
		this.label = label;
		this.priority = priority;
		this.done = false;
	}
	
	public String getTaskType(){
		return taskType;
	}
	
	public String getContent(){
		return content;
	}

	public GregorianCalendar getStart(){
		return start;
	}

	public GregorianCalendar getEnd(){
		return end;
	}
	
	public int getDuration(){
		return duration;
	}
	
	public GregorianCalendar getReminder(){
		return reminder;
	}
	
	public String getLabel(){
		return label;
	}

	public boolean isPriority(){
		return priority;
	}
	
	public boolean isDone(){
		return done;
	}

	public void setTaskType(String type){
		this.taskType = type;
	}
	
	public void setContent(String content){
		this.content = content;
	}
	
	public void setStart(GregorianCalendar start){
		this.start = start;
	}
	
	public void setEnd(GregorianCalendar end){
		this.end = end;
	}
	
	public void setDuration(int duration){
		this.duration = duration;
	}
	
	public void setReminder(GregorianCalendar reminder){
		this.reminder = reminder;
	}
	
	public void setLabel(String label){
		this.label = label;
	}
	
	public void setPriority(){
		this.priority = !(this.priority);
	}
	
	public void setDone(){
		this.done = !(this.done);
	}
	
	public String toString(){
		String finalString = "";
		String startDate = start.get(Calendar.DAY_OF_MONTH) + "/" + start.get(Calendar.MONTH) + "/" + start.get(Calendar.YEAR);
		String endDate = end.get(Calendar.DAY_OF_MONTH) + "/" + end.get(Calendar.MONTH) + "/" + end.get(Calendar.YEAR);
		String reminderDate = reminder.get(Calendar.DAY_OF_MONTH) + "/" + reminder.get(Calendar.MONTH) + "/" + reminder.get(Calendar.YEAR);
		finalString += taskType + "     " + content + "      " + duration + "      " + startDate + "     " + endDate + "    " + reminderDate + "     " + label 
				+ "     ";
		return finalString;
	}
}


@@ -1961,16 +1961,17 @@
 g = %22%22;%0A
+%0A
 %09%09String
@@ -1982,16 +1982,120 @@
 rtDate =
+ %22nil%22;%0A%09%09String endDate = %22nil%22;%0A%09%09String reminderDate = %22nil%22;%0A%09%09%0A%09%09if (start != null)%7B%0A%09%09%09startDate =
  start.g
@@ -2186,31 +2186,55 @@
 ar.YEAR);%0A%09%09
-String 
+%7D%0A%09%09%0A%09%09%0A%09%09if (end != null)%7B%0A%09%09%09
 endDate = en
@@ -2324,31 +2324,57 @@
 ar.YEAR);%0A%09%09
-String 
+%7D%0A%09%09%0A%09%09if (reminder != null)%7B%0A%09%09%09
 reminderDate
@@ -2486,16 +2486,23 @@
 .YEAR);%0A
+%09%09%7D%0A%09%09%0A
 %09%09finalS

modify toString method