public abstract class NumberChoiceFromList<T extends Number> extends ChoiceGeneratorBase<T>
Modifier and Type | Field and Description |
---|---|
protected int |
count |
protected T[] |
values |
Modifier | Constructor and Description |
---|---|
|
NumberChoiceFromList(Config conf,
String id) |
protected |
NumberChoiceFromList(String id)
super constructor for subclasses that want to configure themselves
|
protected |
NumberChoiceFromList(String id,
T[] vals) |
Modifier and Type | Method and Description |
---|---|
void |
advance()
advance to the next choice.
|
protected abstract T[] |
createValueArray(int len) |
protected abstract T |
getDefaultValue() |
T |
getNextChoice() |
int |
getProcessedNumberOfChoices() |
int |
getTotalNumberOfChoices() |
String |
getValueLabel()
get String label of current value, as specified in config file
|
boolean |
hasMoreChoices() |
protected abstract T |
newValue(Number num,
int sign) |
protected T |
parse(String varSpec,
StackFrame resolveFrame) |
protected abstract T |
parseLiteral(String literal,
int sign) |
NumberChoiceFromList<T> |
randomize()
turn the order of choices random (if it isn't already).
|
NumberChoiceFromList<T> |
reorder(Comparator<T> comparator)
reorder according to a user provided comparator
|
void |
reset()
this has to reset the CG to its initial state, which includes resetting
'isDone'
|
boolean |
supportsReordering() |
String |
toString() |
addAttr, advance, attrIterator, attrIterator, clone, deepClone, getAll, getAllOfType, getAttr, getAttr, getCascade, getCascadedParent, getId, getIdRef, getInsn, getNextAttr, getPreviousChoiceGenerator, getPreviousChoiceGeneratorOfType, getSourceLocation, getThreadInfo, hasAttr, hasAttr, hasAttrValue, init, isCascaded, isDone, isProcessed, isSchedulingPoint, removeAttr, replaceAttr, select, setAttr, setCascaded, setContext, setDone, setId, setIdRef, setInsn, setPreviousChoiceGenerator, setThreadInfo, useRandomization
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChoiceType
protected NumberChoiceFromList(String id)
id
- name used in choice configprotected abstract T[] createValueArray(int len)
protected abstract T getDefaultValue()
public void reset()
ChoiceGenerator
public T getNextChoice()
ChoiceGenerator.getNextChoice()
public boolean hasMoreChoices()
ChoiceGenerator.hasMoreChoices()
public void advance()
ChoiceGenerator
ChoiceGenerator.advance()
public String getValueLabel()
public int getTotalNumberOfChoices()
public int getProcessedNumberOfChoices()
public boolean supportsReordering()
supportsReordering
in interface ChoiceGenerator<T extends Number>
supportsReordering
in class ChoiceGeneratorBase<T extends Number>
protected T parse(String varSpec, StackFrame resolveFrame)
public NumberChoiceFromList<T> reorder(Comparator<T> comparator)
ChoiceGeneratorBase
reorder
in interface ChoiceGenerator<T extends Number>
reorder
in class ChoiceGeneratorBase<T extends Number>
public String toString()
toString
in class ChoiceGeneratorBase<T extends Number>
public NumberChoiceFromList<T> randomize()
ChoiceGenerator
randomize
in interface ChoiceGenerator<T extends Number>
randomize
in class ChoiceGeneratorBase<T extends Number>