|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MessageQueue
Implements a prioritized queue of items. Items are dequeued in order of
their priority, where a lower value priority comes first in the queue.
Priority values should be in the range [0, priorities), where
priorities
is the queue initialization parameter.
Nested Class Summary | |
---|---|
static class |
MessageQueue.NoDropMessageQueue
|
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 queue is empty. |
boolean |
isFull()
Return whether the queue 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 queue. |
Method Detail |
---|
boolean isEmpty()
boolean isFull()
int size()
void insert(QueuedMessage msg)
msg
- message to insertQueuedMessage get()
QueuedMessage remove()
void insert(QueuedMessage msg, int pri)
msg
- message to insertpri
- message priorityint getPri()
QueuedMessage get(int pri)
pri
- priority of message requested
QueuedMessage remove(int pri)
pri
- priority of message requested
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |