public final class TimeServerLinked extends java.lang.Object implements TimeServer
| Modifier and Type | Class and Description |
|---|---|
private static class |
TimeServerLinked.Node |
| Modifier and Type | Field and Description |
|---|---|
private long |
currentTime |
private TimeServerLinked.Node |
head |
private int |
size |
| Constructor and Description |
|---|
TimeServerLinked() |
| Modifier and Type | Method and Description |
|---|---|
long |
currentTime() |
(package private) Agent |
dequeue() |
(package private) boolean |
empty() |
void |
enqueue(long waketime,
Agent agent) |
void |
run(int duration) |
(package private) int |
size() |
java.lang.String |
toString() |
private long currentTime
private int size
private TimeServerLinked.Node head
public TimeServerLinked()
public java.lang.String toString()
toString in class java.lang.Objectpublic long currentTime()
currentTime in interface TimeServerpublic void enqueue(long waketime, Agent agent) throws java.lang.IllegalArgumentException
enqueue in interface TimeServerjava.lang.IllegalArgumentExceptionAgent dequeue() throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsExceptionint size()
boolean empty()
public void run(int duration)
run in interface TimeServer