package scheduleGenerator;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;

/**
 * Contains a Person object.
 *
 * @author saslavns.
 *         Created Oct 25, 2012.
 */
public class Person {
	private String name;
	/**
	 * Returns the value of the field called 'name'.
	 * @return Returns the name.
	 */
	public String getName() {
		return this.name;
	}
//	private ArrayList<DateTimePair> availability;
	private ArrayList<String> jobs;
	private ArrayList<String> timeOfDay;
//	private Iterator<String> jobIter;
//	private Iterator<DateTimePair> availabilityIter;
	private HashMap<String, ArrayList<String>> avail;
	
	/**
	 * Holds all the valuable information on each individual person.
	 *
	 * @param name
	 */
	public Person(String name)
	{
		this.name = name;
//		this.availability = new ArrayList<DateTimePair>();
		this.jobs = new ArrayList<String>();
//		this.jobIter = jobs.iterator();
//		this.availabilityIter = availability.iterator();
		this.avail = new HashMap<String, ArrayList<String>>();
		this.timeOfDay= new ArrayList<String>();
	}
	
	/**
	 * TODO Put here a description of what this method does.
	 *
	 * @param date
	 * @param timeOfDay
	 */
	public void addAvailability(String date) {
		this.avail.put(date, this.timeOfDay);
	}
	
	public void addTimeOfDay(String timeOfDay){
		this.timeOfDay.add(timeOfDay);
	}
	
	/**
	 * TODO Put here a description of what this method does.
	 *
	 * @param date
	 * @return
	 */
	public HashMap<String, ArrayList<String>> getAvailability() {
		return this.avail;
	}
	
	/**
	 * TODO Put here a description of what this method does.
	 *
	 * @param job
	 */
	
	public void clearTimes(){
		this.timeOfDay= new ArrayList<String>();
	}
	
	public void addJob(String job) {
		this.jobs.add(job);
	}
	
	/**
	 * TODO Put here a description of what this method does.
	 *
	 * @return
	 */

	public ArrayList<String> getJobs() {
		return this.jobs;
	}
/*
	@Override
	public String toString() {
		return "Person [name=" + this.name + ", jobs=" + this.jobs + ", avail="
				+ this.avail + "]";
	}
	
//	/**
//	 * TODO Put here a description of what this method does.
//	 *
//	 * @param dtp
//	 */
//	public void addDateTimePair(DateTimePair dtp) {
//		this.availability.add(dtp);
//	}
	
//	/**
//	 * TODO Put here a description of what this method does.
//	 *
//	 * @return
//	 */
//	public DateTimePair getNextDateTimePair() {
//		return this.availabilityIter.next();
//	}
}
