package model;

import java.util.ArrayList;

public class TimeWindow {

	private String start;
	private String end;
	private ArrayList<Delivery> deliveries = new ArrayList<Delivery>();

	public TimeWindow(String start, String end) {
		this.start = start;
		this.end = end;
	}

	/**
	 * Add a delivery to the time window
	 * 
	 * @param d
	 */
	public void addDelivery(Delivery d) {
		deliveries.add(d);
	}

	/**
	 * Return the starting hour of the time window
	 * 
	 * @return
	 */
	public String getStart() {
		return start;
	}

	/**
	 * Return the ending hour of the time window
	 * 
	 * @return
	 */
	public String getEnd() {
		return end;
	}

	/**
	 * Return the list of deliveries
	 * 
	 * @return
	 */
	public ArrayList<Delivery> getDeliveries() {
		return deliveries;
	}
}

@@ -396,24 +396,728 @@
 add(d);%0A%09%7D%0A%0A
+%09/**%0A%09 * Delete a delivery from the list of deliveries%0A%09 * @param d%0A%09 */%0A%09public void deleteDelivery(Delivery d)%7B%0A%09%09for(int i=0;i%3Cdeliveries.size();++i)%7B%0A%09%09%09if(deliveries.get(i).equals(d))%7B%0A%09%09%09%09deliveries.remove(i);%0A%09%09%09%09break;%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%09/**%0A%09 * Swap two deliveries%0A%09 * @param d1%0A%09 * @param d2%0A%09 */%0A%09public void swapDeliveries(Delivery d1, Delivery d2)%7B%0A%09%09int i,j;%0A%09%09for(i=0;i%3Cdeliveries.size();++i)%0A%09%09%09if(deliveries.get(i).equals(d1))%0A%09%09%09%09break;%0A%09%09for(j=0;j%3Cdeliveries.size();++j)%0A%09%09%09if(deliveries.get(j).equals(d2))%0A%09%09%09%09break;%0A%09%09if(i!=deliveries.size() && j!=deliveries.size())%0A%09%09%7B%0A%09%09%09Delivery tmp = deliveries.get(i);%0A%09%09%09deliveries.set(i, deliveries.get(j));%0A%09%09%09deliveries.set(j, tmp);%0A%09%09%7D%0A%09%7D%0A%09%0A%09%0A
 %09/**%0A%09 * Ret
@@ -1475,10 +1475,14 @@
 ies;%0A%09%7D%0A
+%09%0A%09%0A
 %7D%0A

Add of missing methods