public class XThreadStringBuffer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
abandoned |
protected java.util.List<java.lang.String> |
buffer |
protected boolean |
complete |
protected static int |
MAX_SIZE |
Constructor and Description |
---|
XThreadStringBuffer()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
abandon()
Signal that the buffer should be abandoned.
|
void |
add(java.lang.String string)
Add a string to the buffer, and block if the buffer is full
|
java.lang.String |
fetch()
Pull an id off the buffer, and wait if there's more to come.
|
void |
signalDone()
Signal that the operation is complete, and that no more strings
will be added.
|
protected static int MAX_SIZE
protected java.util.List<java.lang.String> buffer
protected boolean complete
protected boolean abandoned
public void add(java.lang.String string) throws java.lang.InterruptedException
java.lang.InterruptedException
public void abandon()
public void signalDone()
public java.lang.String fetch() throws java.lang.InterruptedException
java.lang.InterruptedException