|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.realtime.WaitFreeReadQueue
A queue that provides unsynchronized nonblocking read() and synchronized blocking write().
Constructor Summary | |
WaitFreeReadQueue(int maximum,
boolean notify)
|
|
WaitFreeReadQueue(int maximum,
MemoryArea memory,
boolean notify)
|
|
WaitFreeReadQueue(Thread writer,
Thread reader,
int maximum,
MemoryArea memory)
Constructs a new WaitFreeReadQueue . |
|
WaitFreeReadQueue(Thread writer,
Thread reader,
int maximum,
MemoryArea memory,
boolean notify)
Constructs a new WaitFreeReadQueue. |
Method Summary | |
void |
clear()
Empties the queue. |
boolean |
isEmpty()
Checks if the queue is empty. |
boolean |
isFull()
Checks if the queue is full. |
Object |
read()
An unsynchronized and nonblocking read operation. |
int |
size()
Returns the number of elements in the queue. |
void |
waitForData()
If the queue is empty, this method doesn't return until the writing thread inserts an element. |
boolean |
write(Object object)
A synchronized and blocking write operation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WaitFreeReadQueue(Thread writer, Thread reader, int maximum, MemoryArea memory, boolean notify)
writer
- the writing threadreader
- the reading threadmaximum
- the capacity of the queuememory
- the MemoryArea
in which to allocate the
queue's buffer; if null, then the current memory area is
usednotify
- whether to notify the reader when data is added
[unclear in spec, so unimplemented in jRate]public WaitFreeReadQueue(Thread writer, Thread reader, int maximum, MemoryArea memory)
WaitFreeReadQueue
.
writer
- the writing threadreader
- the reading threadmaximum
- the capacity of the queuememory
- the MemoryArea
in which to allocate the
queue's buffer; if null, then the current memory area is
usedpublic WaitFreeReadQueue(int maximum, MemoryArea memory, boolean notify)
public WaitFreeReadQueue(int maximum, boolean notify)
Method Detail |
public void clear()
public boolean isEmpty()
public boolean isFull()
public int size()
public Object read()
public void waitForData()
public boolean write(Object object) throws MemoryScopeException
object
- the object to write to the queue
MemoryScopeException
- if the object is in an
incompatible memory area
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |