|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.osmosis.core.store.DataPostbox<T>
T
- The type of data held in the postbox.public class DataPostbox<T>
This class provides a mechanism for a thread to pass data to another thread. Both threads will block until the other is ready. It supports a single writing thread, and a single reading thread. Multiple reading or writing threads are NOT supported.
Constructor Summary | |
---|---|
DataPostbox(int capacity)
Creates a new instance. |
Method Summary | |
---|---|
void |
complete()
Marks input is complete. |
T |
getNext()
Returns the next available object from the postbox. |
boolean |
hasNext()
Indicates if data is available for output. |
void |
put(T o)
Adds a new object to the postbox. |
void |
release()
Must be called at the end of input processing regardless of whether errors have occurred. |
void |
setOutputError()
Allows an output thread to signal that it has failed, this will cause exceptions to be thrown if more data is sent by input input threads. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataPostbox(int capacity)
capacity
- The maximum number of objects to hold in the postbox before
blocking.Method Detail |
---|
public void put(T o)
o
- The object to be added.public void complete()
public void release()
public boolean hasNext()
public T getNext()
public void setOutputError()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |