@@ -0,0 +1,1239 @@
+import java.util.Iterator;%0Aimport java.util.LinkedList;%0A%0A/**%0A * @author Sbastien%0A * A class to represent a telescope schedule%0A */%0Apublic class Schedule %7B%0A%0A%09private LinkedList%3CPlan%3E planning;%0A%09%0A%09public Schedule() %7B%0A%09%09this.planning = new LinkedList%3CPlan%3E();%0A%09%7D%0A%09%0A%09/**%0A%09 * Add an observation to the planning%0A%09 * @param o: the observation to add%0A%09 */%0A%09public void add(Plan p) %7B%0A%09%09this.planning.add(p);%0A%09%7D%0A%09%0A%09/**%0A%09 * A method to check if the current schedule is valid%0A%09 * Check:%0A%09 * -same star not twice%0A%09 * -all plan are compatible with each other%0A%09 * @return true if the schedule is valid%0A%09 */%0A%09public boolean isValid() %7B%0A%09%09boolean valid = true;%0A%09%09Iterator%3CPlan%3E i = planning.iterator();%0A%09%09while(i.hasNext()) %7B%0A%09%09%09Plan p = i.next();%0A%09%09%09Iterator%3CPlan%3E i2 = planning.iterator();%0A%09%09%09while(i2.hasNext()) %7B%0A%09%09%09%09Plan p2 = i2.next();%0A%09%09%09%09if(p.getStar() == p2.getStar() %7C%7C !p.isCompatible(p2)) %7B%0A%09%09%09%09%09valid = false;%0A%09%09%09%09%09break;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%09if(!valid) %7B break; %7D%0A%09%09%7D%0A%09%09return valid;%0A%09%7D%0A%09%0A%09/**%0A%09 * A method to compute the value of the proposed schedule%0A%09 * @return%0A%09 */%0A%09public int getValue() %7B%0A%09%09int value = 0;%0A%09%09Iterator%3CPlan%3E i = planning.iterator();%0A%09%09while(i.hasNext()) %7B%0A%09%09%09Plan p = i.next();%0A%09%09%09value += p.getValue();%0A%09%09%7D%0A%09%09return value;%0A%09%7D%0A%7D%0A

Rename "Telescope" to "Schedule" to be more precise