public class SwitchController extends GenericController implements Serializable
Implements a controller which selects at most one of its children based on the condition value, which may be a number or a string.
For numeric input, the controller processes the appropriate child, where the numbering starts from 0. If the number is out of range, then the first (0th) child is selected. If the condition is the empty string, then it is assumed to be 0.
For non-empty non-numeric input, the child is selected by name. This may be the name of the controller or a sampler. If the string does not match any of the names, then the controller with the name "default" (any case) is processed. If there is no default entry, then unlike the numeric case, no child is selected.
current, subControllersAndSamplers
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
SwitchController() |
Modifier and Type | Method and Description |
---|---|
String |
getSelection() |
protected void |
incrementCurrent()
incrementCurrent is called when the current child (whether sampler or controller)
has been processed.
|
Sampler |
next()
Determines the next sampler to be processed.
|
void |
setSelection(String inputValue) |
addIterationListener, addTestElement, addTestElementOnce, currentReturnedNull, fireIterationStart, fireIterEvents, getCurrentElement, getIterCount, getSubControllers, incrementIterCount, initialize, initializeSubControllers, isDone, isFirst, nextIsAController, nextIsASampler, nextIsNull, readResolve, reInitialize, removeCurrentElement, removeIterationListener, resetCurrent, resetIterCount, setCurrentElement, setDone, setFirst, triggerEndOfLoop
addPropertiesValues, addProperty, addProperty, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
public Sampler next()
GenericController
Determines the next sampler to be processed.
If GenericController.isDone()
is true
, returns null.
Gets the list element using current pointer.
If this is null
, calls GenericController.nextIsNull()
.
If the list element is a Sampler
, calls GenericController.nextIsASampler(Sampler)
,
otherwise calls GenericController.nextIsAController(Controller)
If any of the called methods throws NextIsNullException
, returns null
,
otherwise the value obtained above is returned.
next
in interface Controller
next
in class GenericController
null
protected void incrementCurrent()
Setting it to int.max marks the controller as having processed all its children. Thus the controller processes one child per iteration.
Increments the current pointer; called by currentReturnedNull to move the controller on to its next child.
incrementCurrent
in class GenericController
public void setSelection(String inputValue)
public String getSelection()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.