
ValueType - The type of the wrapped valuepublic final class DataDrivenControl<ValueType> extends Object
| Constructor and Description |
|---|
DataDrivenControl()
No-args Constructor.
|
DataDrivenControl(boolean penalizeDuplicatePuts)
Constructor for DataDrivenControl.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addResumable(Runnable resumable)
Attach Runnable instances to the DDC.
|
ValueType |
getValue()
Returns the value associated with the DDC.
|
static void |
pauseOnDdc(DataDrivenControl<? extends Object> ddc)
Utility method to enable blocking busy-wait on a DataDrivenControl.
|
static void |
pauseOnDdc(DataDrivenControl<? extends Object> ddc,
int busyWaitLimit)
Utility method to enable blocking busy-wait on a DataDrivenControl.
|
static void |
pauseOnDdc(DataDrivenControl<? extends Object> ddc,
int busyWaitLimit,
Runnable preUnblockCallback)
pauseOnDdc.
|
static void |
pauseOnDdc(DataDrivenControl<? extends Object> ddc,
Runnable preUnblockCallback)
Utility method to enable blocking busy-wait on a DataDrivenControl.
|
boolean |
setValue(ValueType theValue)
Associated a new value with the DDC and resumes any suspended
Runnable instances. |
String |
toString() |
boolean |
valueAvailable()
This method is not synchronized.
|
public DataDrivenControl()
public DataDrivenControl(boolean penalizeDuplicatePuts)
Constructor for DataDrivenControl.
penalizeDuplicatePuts - whether to report errors for duplicate puts.public static void pauseOnDdc(DataDrivenControl<? extends Object> ddc)
Delegates to pauseOnDdc(DataDrivenControl, int, Runnable)
with the following call: pauseOnDdc(ddc, 1, null)
ddc - The DataDrivenControl to wait on.public static void pauseOnDdc(DataDrivenControl<? extends Object> ddc, int busyWaitLimit)
Delegates to pauseOnDdc(DataDrivenControl, int, Runnable)
with the following call: pauseOnDdc(ddc, busyWaitLimit, null)
ddc - The DataDrivenControl to wait on.busyWaitLimit - The number of iterations to attempt to check the DDC before resorting to more expensive blocking thread callspublic static void pauseOnDdc(DataDrivenControl<? extends Object> ddc, Runnable preUnblockCallback)
Delegates to pauseOnDdc(DataDrivenControl, int, Runnable)
with the following call: pauseOnDdc(ddc, 1, preUnblockCallback)
ddc - The DataDrivenControl to wait on.preUnblockCallback - a Runnable object.public static void pauseOnDdc(DataDrivenControl<? extends Object> ddc, int busyWaitLimit, Runnable preUnblockCallback)
pauseOnDdc.
ddc - a DataDrivenControl object.busyWaitLimit - The number of iterations to attempt to check the DDC before resorting to more expensive blocking thread callspreUnblockCallback - a Runnable object.public boolean setValue(ValueType theValue) throws IllegalStateException
Runnable instances.theValue - the value to associate with the DDCtheValue with the DDC, false otherwiseIllegalStateException - when a second setValue() is attemptedpublic boolean valueAvailable()
public ValueType getValue()
public void addResumable(Runnable resumable)
resumable - The Runnable instance to attachCopyright © 2014 Rice University - Department of Computer Science. All rights reserved.