public class XThreadStringBuffer extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
abandoned |
protected List<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(String string)
Add a string to the buffer, and block if the buffer is full
|
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 boolean complete
protected boolean abandoned
public void add(String string) throws InterruptedException
InterruptedException
public void abandon()
public void signalDone()
public String fetch() throws InterruptedException
InterruptedException