/*
 * Copyright (c) 2011, Patrik Dufresne. All rights reserved.
 * Patrik Dufresne PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.planimod.core;

import java.util.Collection;

import com.patrikdufresne.util.BidiMultiHashMap;
import com.patrikdufresne.util.BidiMultiMap;

/**
 * This class
 * 
 * @author Patrik Dufresne
 * 
 */
public class TaskNonAvailabilityTable extends
		BidiMultiHashMap<Employee, Task> {

	public TaskNonAvailabilityTable(
			Collection<NonAvailability> nonavailabilities,
			Collection<Task> tasks) {

		BidiMultiMap<Employee, Task> table = new BidiMultiHashMap<Employee, Task>();
		for (Task t : tasks) {
			for (NonAvailability na : nonavailabilities) {
				if (TimeRanges.intersectEquals(na, t)) {
					put(na.getEmployee(), t);
				}
			}
		}

	}

}