|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.justobjects.pushlet.core.EventQueue
FIFO queue with guarded suspension.
Purpose
| Field Summary | |
private int |
capacity
Defines maximum queue size |
private int |
front
|
private Event[] |
queue
|
private int |
rear
|
| Constructor Summary | |
EventQueue()
Construct queue with default (8) capacity. |
|
EventQueue(int capacity)
Construct queue with specified capacity. |
|
| Method Summary | |
Event |
deQueue()
Get head; if empty wait until something in queue. |
Event |
deQueue(long maxWaitTime)
Get head; if empty wait for specified time at max. |
Event[] |
deQueueAll(long maxWaitTime)
Get all queued Events. |
boolean |
enQueue(Event item)
Put item in queue; waits() indefinitely if queue is full. |
boolean |
enQueue(Event item,
long maxWaitTime)
Put item in queue; if full wait maxtime. |
private Event |
fetchNext()
Circular counter. |
int |
getSize()
|
boolean |
isEmpty()
Is the queue empty ? |
boolean |
isFull()
Is the queue full ? |
static void |
main(java.lang.String[] args)
|
private int |
next(int index)
Circular counter. |
static void |
p(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int capacity
private Event[] queue
private int front
private int rear
| Constructor Detail |
public EventQueue()
public EventQueue(int capacity)
| Method Detail |
public boolean enQueue(Event item)
throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean enQueue(Event item,
long maxWaitTime)
throws java.lang.InterruptedException
java.lang.InterruptedException
public Event deQueue()
throws java.lang.InterruptedException
java.lang.InterruptedException
public Event deQueue(long maxWaitTime)
throws java.lang.InterruptedException
java.lang.InterruptedException
public Event[] deQueueAll(long maxWaitTime)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic int getSize()
public boolean isEmpty()
public boolean isFull()
private int next(int index)
private Event fetchNext()
public static void p(java.lang.String s)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||