public interface ChoiceGenerator<T> extends Cloneable
Modifier and Type | Method and Description |
---|---|
void |
addAttr(Object a) |
void |
advance()
advance to the next choice.
|
void |
advance(int nChoices) |
ObjectList.Iterator |
attrIterator() |
<A> ObjectList.TypedIterator<A> |
attrIterator(Class<A> attrType) |
ChoiceGenerator<?> |
clone() |
ChoiceGenerator<?> |
deepClone() |
ChoiceGenerator<?>[] |
getAll()
return array with all parents and this CG, in registration order
|
<C extends ChoiceGenerator<?>> |
getAllOfType(Class<C> cgType)
return array with all CGs (including this one) of given 'cgType', in registration order
|
Object |
getAttr()
this returns all of them - use either if you know there will be only
one attribute at a time, or check/process result with ObjectList
|
<A> A |
getAttr(Class<A> attrType)
this only returns the first attr of this type, there can be more
if you don't use client private types or the provided type is too general
|
ChoiceGenerator<?>[] |
getCascade()
return array with all cascaded parents and this CG, in registration order
|
ChoiceGenerator<?> |
getCascadedParent()
returns the prev CG if it was registered for the same insn
|
Class<T> |
getChoiceType() |
String |
getId() |
int |
getIdRef() |
Instruction |
getInsn() |
<A> A |
getNextAttr(Class<A> attrType,
Object prev) |
T |
getNextChoice() |
ChoiceGenerator<?> |
getPreviousChoiceGenerator() |
<T extends ChoiceGenerator<?>> |
getPreviousChoiceGeneratorOfType(Class<T> cls) |
int |
getProcessedNumberOfChoices() |
String |
getSourceLocation() |
ThreadInfo |
getThreadInfo() |
int |
getTotalNumberOfChoices() |
boolean |
hasAttr() |
boolean |
hasAttr(Class<?> attrType) |
boolean |
hasMoreChoices() |
boolean |
isCascaded() |
boolean |
isDone() |
boolean |
isProcessed() |
boolean |
isSchedulingPoint() |
ChoiceGenerator<T> |
randomize()
turn the order of choices random (if it isn't already).
|
void |
removeAttr(Object a) |
ChoiceGenerator<T> |
reorder(Comparator<T> comparator)
reorder according to a user provided comparator
|
void |
replaceAttr(Object oldAttr,
Object newAttr) |
void |
reset()
this has to reset the CG to its initial state, which includes resetting
'isDone'
|
void |
select(int nChoice) |
void |
setAttr(Object a)
this replaces all of them - use only if you know
- there will be only one attribute at a time
- you obtained the value you set by a previous getXAttr()
- you constructed a multi value list with ObjectList.createList()
|
void |
setCascaded() |
void |
setContext(ThreadInfo tiCreator) |
void |
setDone() |
void |
setId(String id) |
void |
setIdRef(int idRef) |
void |
setInsn(Instruction insn) |
void |
setPreviousChoiceGenerator(ChoiceGenerator<?> cg) |
void |
setThreadInfo(ThreadInfo ti) |
boolean |
supportsReordering() |
T getNextChoice()
boolean hasMoreChoices()
void advance()
void advance(int nChoices)
void select(int nChoice)
boolean isDone()
void setDone()
boolean isProcessed()
void reset()
int getTotalNumberOfChoices()
int getProcessedNumberOfChoices()
ChoiceGenerator<?> getPreviousChoiceGenerator()
ChoiceGenerator<T> randomize()
ChoiceGenerator<?> clone() throws CloneNotSupportedException
CloneNotSupportedException
ChoiceGenerator<?> deepClone() throws CloneNotSupportedException
CloneNotSupportedException
String getId()
int getIdRef()
void setIdRef(int idRef)
void setId(String id)
boolean isSchedulingPoint()
void setThreadInfo(ThreadInfo ti)
ThreadInfo getThreadInfo()
void setInsn(Instruction insn)
Instruction getInsn()
void setContext(ThreadInfo tiCreator)
String getSourceLocation()
boolean supportsReordering()
ChoiceGenerator<T> reorder(Comparator<T> comparator)
void setPreviousChoiceGenerator(ChoiceGenerator<?> cg)
void setCascaded()
boolean isCascaded()
<T extends ChoiceGenerator<?>> T getPreviousChoiceGeneratorOfType(Class<T> cls)
ChoiceGenerator<?> getCascadedParent()
ChoiceGenerator<?>[] getCascade()
ChoiceGenerator<?>[] getAll()
<C extends ChoiceGenerator<?>> C[] getAllOfType(Class<C> cgType)
boolean hasAttr()
boolean hasAttr(Class<?> attrType)
Object getAttr()
void setAttr(Object a)
void addAttr(Object a)
void removeAttr(Object a)
<A> A getAttr(Class<A> attrType)
ObjectList.Iterator attrIterator()
<A> ObjectList.TypedIterator<A> attrIterator(Class<A> attrType)