package test.rewolucja.scheduling.queue; import gridsim.Gridlet; import java.util.ArrayList; import org.joda.time.DateTime; import test.rewolucja.GSSIMJobInterface; public class Queue extends ArrayList> implements QueueInterface>{ private static final long serialVersionUID = 6576299222910508209L; protected String name; protected int priority; protected boolean supportReservation; public Queue (boolean supportReservation){ name = "Queue"; priority = 0; this.supportReservation = supportReservation; } public boolean add(GSSIMJobInterface job){ try { job.setStatus(Gridlet.QUEUED); } catch(Exception e){ throw new RuntimeException(e); } return super.add(job); } public void add(int pos, GSSIMJobInterface job){ try { job.setStatus(Gridlet.QUEUED); } catch(Exception e){ throw new RuntimeException(e); } super.add(pos, job); } public DateTime getArrivalTime(int pos) throws IndexOutOfBoundsException { //return get(pos).getSubmissionTimeToBroker(); return null; } public String getName() { return name; } public int getPriority() { return priority; } public void setName(String name) { this.name = name; } public void setPriority(int priority) { this.priority = priority; } public boolean supportReservations() { return supportReservation; } }