|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjist.swans.net.MessageQueue.NoDropMessageQueue
public static class MessageQueue.NoDropMessageQueue
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface jist.swans.net.MessageQueue |
|---|
MessageQueue.NoDropMessageQueue |
| Field Summary | |
|---|---|
private byte |
capacity
List size limit. |
private QueuedMessage[] |
heads
Heads of message queues for different priorities. |
private byte |
size
Length of list. |
private QueuedMessage[] |
tails
Tails of message queues for different priorities. |
private byte |
topPri
Index of highest priority. |
| Constructor Summary | |
|---|---|
MessageQueue.NoDropMessageQueue(byte priorities,
byte capacity)
Initialize prioritized message queue. |
|
| Method Summary | |
|---|---|
QueuedMessage |
get()
Return first message, but do not dequeue. |
QueuedMessage |
get(int pri)
Return first message of given priority, but do not dequeue. |
int |
getPri()
Return priority of first queued message. |
void |
insert(QueuedMessage msg)
Insert message into queue at end (with lowest priority). |
void |
insert(QueuedMessage msg,
int pri)
Insert message into queue with given priority. |
boolean |
isEmpty()
Return whether list is empty. |
boolean |
isFull()
Return whether the list is filled to capacity. |
QueuedMessage |
remove()
Return first message and dequeue. |
QueuedMessage |
remove(int pri)
Return first message with given priority and dequeue. |
int |
size()
Return number of items in the list. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private QueuedMessage[] heads
private QueuedMessage[] tails
private byte topPri
private byte size
private byte capacity
| Constructor Detail |
|---|
public MessageQueue.NoDropMessageQueue(byte priorities,
byte capacity)
priorities - number of priority levelscapacity - maximum number of items allowed in list| Method Detail |
|---|
public boolean isEmpty()
isEmpty in interface MessageQueuepublic boolean isFull()
isFull in interface MessageQueuepublic int size()
size in interface MessageQueue
public void insert(QueuedMessage msg,
int pri)
insert in interface MessageQueuemsg - message to insertpri - message prioritypublic void insert(QueuedMessage msg)
insert in interface MessageQueuemsg - message to insertpublic int getPri()
getPri in interface MessageQueuepublic QueuedMessage get(int pri)
get in interface MessageQueuepri - priority of message requested
public QueuedMessage get()
get in interface MessageQueuepublic QueuedMessage remove(int pri)
remove in interface MessageQueuepri - priority of message requested
public QueuedMessage remove()
remove in interface MessageQueue
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||