|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.SynchronizedGrowablePipe
This is a pipe designed to be shared between multiple writers threads and a single reader thread.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement |
private static DAILogger |
LOG
Logger object for logging in this class |
private boolean |
mClosed
Set to true when the pipe is closed. |
private java.util.List |
mData
Stores the blocks that are put onto the pipe. |
Constructor Summary | |
SynchronizedGrowablePipe()
|
Method Summary | |
void |
close()
Closes the block writer to indicate that there are no more blocks are to be written. |
boolean |
hasNext()
Indicates whether or not there are any more blocks of data to be read from the block reader. |
boolean |
isOpen()
Indicates whether or not the block writer is open for writing via the put method. |
java.lang.Object |
next()
Gets the next block of data contained in the block reader. |
void |
put(java.lang.Object block)
Writes the specified block of output data. |
void |
waitForBlock()
Wait for a block of data to appear on the pipe. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private final java.util.List mData
private boolean mClosed
true
when the pipe is closed.
Constructor Detail |
public SynchronizedGrowablePipe()
Method Detail |
public java.lang.Object next()
BlockReader
next
in interface BlockReader
Object
public void close()
BlockWriter
put
method should no longer be used.
close
in interface BlockWriter
public void put(java.lang.Object block)
BlockWriter
put
in interface BlockWriter
block
- the Object
block to writepublic boolean hasNext()
BlockReader
hasNext
in interface BlockReader
public void waitForBlock()
public boolean isOpen()
BlockWriter
put
method. After the close
method has been
invoked this method should return false
.
isOpen
in interface BlockWriter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |