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.Object
public long currentTime()
currentTime
in interface TimeServer
public void enqueue(long waketime, Agent agent) throws java.lang.IllegalArgumentException
enqueue
in interface TimeServer
java.lang.IllegalArgumentException
Agent dequeue() throws java.lang.IndexOutOfBoundsException
java.lang.IndexOutOfBoundsException
int size()
boolean empty()
public void run(int duration)
run
in interface TimeServer