|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.curjent.impl.agent.Queue
final class Queue
Implements a doubly linked linked list for agent messages.
Field Summary | |
---|---|
private int |
capacity
Current queue capacity. |
private int |
count
Current message count. |
private Message |
head
Next message for processing or null if empty. |
private int |
synthetic
Synthetic message count. |
Constructor Summary | |
---|---|
Queue()
|
Method Summary | |
---|---|
(package private) int |
capacity()
Returns the queue's capacity. |
(package private) void |
capacity(int value)
Sets the queue's capacity. |
(package private) int |
count()
Returns the number of queued messages. |
(package private) void |
dequeue(Message message)
Removes the given message from the queue. |
(package private) boolean |
empty()
Returns true if the queue has no messages. |
(package private) void |
enqueue(Message message)
Adds the given message to the end of the queue. |
(package private) void |
finish(Message message)
Dequeues the message if necessary and decrements the count. |
(package private) boolean |
full()
Returns true if the number of messages has reached this
queue's capacity. |
(package private) Message |
head()
Returns the head of the queue if any. |
(package private) Message |
next(Message message)
Return the next message in the queue or null if the given
message is the last message. |
String |
toString()
Returns the current message count. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private Message head
null
if empty.
private int count
private int synthetic
private int capacity
Constructor Detail |
---|
Queue()
Method Detail |
---|
Message head()
boolean empty()
true
if the queue has no messages.
boolean full()
true
if the number of messages has reached this
queue's capacity.
int count()
int capacity()
void capacity(int value)
Message next(Message message)
null
if the given
message is the last message.
void enqueue(Message message)
void dequeue(Message message)
void finish(Message message)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |