public final class TimeServerQueue extends java.util.Observable implements TimeServer
Modifier and Type | Class and Description |
---|---|
private static class |
TimeServerQueue.Node |
Modifier and Type | Field and Description |
---|---|
private double |
currentTime |
private java.util.PriorityQueue<TimeServerQueue.Node> |
queue |
Constructor and Description |
---|
TimeServerQueue() |
Modifier and Type | Method and Description |
---|---|
double |
currentTime() |
(package private) Agent |
dequeue() |
(package private) boolean |
empty() |
void |
enqueue(double waketime,
Agent agent) |
void |
run(double duration) |
(package private) int |
size() |
java.lang.String |
toString() |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addObserver, deleteObserver
private double currentTime
private java.util.PriorityQueue<TimeServerQueue.Node> queue
public TimeServerQueue()
public java.lang.String toString()
toString
in class java.lang.Object
public double currentTime()
currentTime
in interface TimeServer
public void enqueue(double waketime, Agent agent) throws java.lang.IllegalArgumentException
enqueue
in interface TimeServer
java.lang.IllegalArgumentException
int size()
boolean empty()
public void run(double duration)
run
in interface TimeServer