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<?> ddc)
Utility method to enable blocking busy-wait on a DataDrivenControl.
|
static void |
pauseOnDdc(DataDrivenControl<?> ddc,
int busyWaitLimit)
Utility method to enable blocking busy-wait on a DataDrivenControl.
|
static void |
pauseOnDdc(DataDrivenControl<?> ddc,
int busyWaitLimit,
Runnable preUnblockCallback)
pauseOnDdc.
|
static void |
pauseOnDdc(DataDrivenControl<?> 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<?> ddc) throws SuspendableException
Delegates to pauseOnDdc(DataDrivenControl, int,
Runnable)
with the following call: pauseOnDdc(ddc, 1, null)
ddc
- The DataDrivenControl to wait on.SuspendableException
public static void pauseOnDdc(DataDrivenControl<?> ddc, int busyWaitLimit, Runnable preUnblockCallback) throws SuspendableException
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.SuspendableException
public boolean valueAvailable()
public void addResumable(Runnable resumable)
resumable
- The Runnable instance to attachpublic static void pauseOnDdc(DataDrivenControl<?> ddc, int busyWaitLimit) throws SuspendableException
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 callsSuspendableException
public static void pauseOnDdc(DataDrivenControl<?> ddc, Runnable preUnblockCallback) throws SuspendableException
Delegates to pauseOnDdc(DataDrivenControl, int,
Runnable)
with the following call: pauseOnDdc(ddc, 1, preUnblockCallback)
ddc
- The DataDrivenControl to wait on.preUnblockCallback
- a Runnable
object.SuspendableException
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 ValueType getValue()
Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.