public class AtomicInput extends Object implements Input, ActivityDefObserver, ProgressCapable
TODO: This documentation is out of date as of 2.0.0
This input will provide threadsafe access to a sequence of long values.
Changes to the cycles or the targetrate will affect the provided inputs. If the min or max cycle is changed, then these are re-applied first to the max cycle and then to the min cycle. If the min cycle is changed, then the next cycle value is set to the assigned min value. Otherwise, the cycle will continue as usual till it reaches the max value. The ability to start the input while running by applying a new set of parameters makes it possible to re-trigger a sequence of inputs during a test.
This input, and Inputs in general do not actively prevent usage of values after the max value. They simply expose it to callers. It is up to the caller to check the value to determine when the input is deemed "used up."
| Constructor and Description |
|---|
AtomicInput(ActivityDef activityDef) |
| Modifier and Type | Method and Description |
|---|---|
CycleSegment |
getInputSegment(int stride)
Return the next InputSegment available, or null if
none were available.
|
double |
getProgress() |
double |
getTotal() |
boolean |
isContiguous() |
void |
onActivityDefUpdate(ActivityDef activityDef) |
String |
toString() |
public AtomicInput(ActivityDef activityDef)
public CycleSegment getInputSegment(int stride)
InputAll implementations of this method are required to be thread-safe.
getInputSegment in interface Inputstride - The number of cycles (not necessarily contiguous) in the segment.public double getProgress()
getProgress in interface ProgressCapablepublic double getTotal()
getTotal in interface ProgressCapablepublic void onActivityDefUpdate(ActivityDef activityDef)
onActivityDefUpdate in interface ActivityDefObserverpublic boolean isContiguous()
isContiguous in interface InputCopyright © 2018. All rights reserved.