create changelog entry
[debian/openrocket] / core / src / net / sf / openrocket / simulation / EventQueue.java
1 package net.sf.openrocket.simulation;
2
3 import java.util.PriorityQueue;
4
5 import net.sf.openrocket.util.Monitorable;
6
7 /**
8  * A sorted queue of FlightEvent objects.  This queue maintains the events in time order
9  * and also keeps a modification count for the queue.
10  * 
11  * @author Sampo Niskanen <sampo.niskanen@iki.fi>
12  */
13 public class EventQueue extends PriorityQueue<FlightEvent> implements Monitorable {
14
15         private int modID = 0;
16         
17         public EventQueue() {
18                 super();
19         }
20
21         public EventQueue(PriorityQueue<? extends FlightEvent> c) {
22                 super(c);
23         }
24
25         @Override
26         public boolean add(FlightEvent e) {
27                 modID++;
28                 return super.add(e);
29         }
30
31         @Override
32         public void clear() {
33                 modID++;
34                 super.clear();
35         }
36
37         @Override
38         public boolean offer(FlightEvent e) {
39                 modID++;
40                 return super.offer(e);
41         }
42
43         @Override
44         public FlightEvent poll() {
45                 modID++;
46                 return super.poll();
47         }
48
49         @Override
50         public boolean remove(Object o) {
51                 modID++;
52                 return super.remove(o);
53         }
54
55         public int getModID() {
56                 return modID;
57         }
58         
59         @Override
60         protected Object clone() throws CloneNotSupportedException {
61                 // TODO Auto-generated method stub
62                 return super.clone();
63         }
64         
65 }