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, setChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddObserver, deleteObserverprivate double currentTime
private java.util.PriorityQueue<TimeServerQueue.Node> queue
public TimeServerQueue()
public java.lang.String toString()
toString in class java.lang.Objectpublic double currentTime()
currentTime in interface TimeServerpublic void enqueue(double waketime, Agent agent) throws java.lang.IllegalArgumentException
enqueue in interface TimeServerjava.lang.IllegalArgumentExceptionint size()
boolean empty()
public void run(double duration)
run in interface TimeServer