package inc.monsters.mias.data;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@SuppressWarnings("serial")
public class EmployeesList implements Serializable {
	private Map<Integer, Employee> emps;
	
	public EmployeesList() {
		emps = new HashMap<Integer, Employee>();

//	     <map-entry>
//	        <key>James.P.Sullivan</key>
//	        <value>n@viLLus</value>
//	      </map-entry>
//	      <map-entry>
//	        <key>Mike.Wazowski</key>
//	        <value>iksW0z@w</value>
//	      </map-entry>
//	      <map-entry>
//	        <key>Celia.Mae</key>
//	        <value>e@M</value>
//	      </map-entry>

//	        <key>Abominable.Snowman</key>
//	        <value>n@mw0nZ</value>
//	      </map-entry>
//	      <map-entry>
//	        <key>Randall.Boggs</key>
//	        <value>sGG0b</value>
//	      </map-entry>
//	      <map-entry>
//	        <key>Roz</key>
//	        <value>Z0r</value>
//	      </map-entry>		
		
		try {
		    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		    int i = 1;
			emps.put(i, new Employee("Henry.J.", "Waternoose", sdf.parse("1953-05-11"), sdf.parse("1990-04-01"), i++, "Chief Execurive Officer", 5000));
			emps.put(i, new Employee("James.P.", "Sullivan",   sdf.parse("1978-04-06"), sdf.parse("1999-07-15"), i++, "Senior Scarer", 2500));
			emps.put(i, new Employee("Mike", "Wazowski",       sdf.parse("1984-12-03"), sdf.parse("2003-11-01"), i++, "Junior Scarer", 2000));
			emps.put(i, new Employee("Celia", "Mae",           sdf.parse("1979-06-13"), sdf.parse("1998-09-30"), i++, "Receptionist", 1500));
			emps.put(i, new Employee("Abominable", "Snowman",  sdf.parse("1957-07-23"), sdf.parse("1990-04-01"), i++, "Snowman", 3000));
			emps.put(i, new Employee("Randall", "Boggs",       sdf.parse("1973-31-08"), sdf.parse("1997-01-01"), i++, "Senior Scarer", 2500));
			emps.put(i, new Employee("Roz", "",                sdf.parse("1903-03-26"), sdf.parse("1990-04-01"), i++, "Bookkeeper", 2700));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public List<Employee> getEmployees() {
		return new ArrayList<Employee>(emps.values());
	}

	public Map<Integer, Employee> getEmployeesWitKeys() {
		return emps;
	}}
