public interface ChoiceGenerator<T>
extends java.lang.Cloneable
Modifier and Type | Method and Description |
---|---|
void |
addAttr(java.lang.Object a) |
void |
advance()
advance to the next choice.
|
void |
advance(int nChoices) |
ObjectList.Iterator |
attrIterator() |
<A> ObjectList.TypedIterator<A> |
attrIterator(java.lang.Class<A> attrType) |
ChoiceGenerator<?> |
clone() |
ChoiceGenerator<?> |
deepClone() |
ChoiceGenerator<?>[] |
getAll()
return array with all parents and this CG, in registration order
|
T[] |
getAllChoices() |
<C extends ChoiceGenerator<?>> |
getAllOfType(java.lang.Class<C> cgType)
return array with all CGs (including this one) of given 'cgType', in registration order
|
java.lang.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(java.lang.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
|
T |
getChoice(int i) |
java.lang.Class<T> |
getChoiceType() |
java.lang.String |
getId() |
int |
getIdRef() |
Instruction |
getInsn() |
<A> A |
getNextAttr(java.lang.Class<A> attrType,
java.lang.Object prev) |
T |
getNextChoice() |
int |
getNumberOfParents() |
ChoiceGenerator<?> |
getPreviousChoiceGenerator() |
<T extends ChoiceGenerator<?>> |
getPreviousChoiceGeneratorOfType(java.lang.Class<T> cls) |
T[] |
getProcessedChoices() |
int |
getProcessedNumberOfChoices() |
java.lang.String |
getSourceLocation() |
int |
getStateId() |
ThreadInfo |
getThreadInfo() |
int |
getTotalNumberOfChoices() |
T[] |
getUnprocessedChoices() |
boolean |
hasAttr() |
boolean |
hasAttr(java.lang.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(java.lang.Object a) |
ChoiceGenerator<T> |
reorder(java.util.Comparator<T> comparator)
reorder according to a user provided comparator
|
void |
replaceAttr(java.lang.Object oldAttr,
java.lang.Object newAttr) |
void |
reset()
this has to reset the CG to its initial state, which includes resetting
'isDone'
|
void |
select(int nChoice) |
void |
setAttr(java.lang.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 |
setCurrent()
to be called before the first advance().
|
void |
setDone() |
void |
setId(java.lang.String id) |
void |
setIdRef(int idRef) |
void |
setInsn(Instruction insn) |
void |
setPreviousChoiceGenerator(ChoiceGenerator<?> cg) |
void |
setStateId(int stateId) |
void |
setThreadInfo(ThreadInfo ti) |
boolean |
supportsReordering() |
T getNextChoice()
java.lang.Class<T> getChoiceType()
boolean hasMoreChoices()
void setCurrent()
void advance()
void advance(int nChoices)
void select(int nChoice)
boolean isDone()
void setDone()
boolean isProcessed()
void reset()
int getTotalNumberOfChoices()
int getProcessedNumberOfChoices()
T getChoice(int i)
T[] getAllChoices()
T[] getProcessedChoices()
T[] getUnprocessedChoices()
ChoiceGenerator<?> getPreviousChoiceGenerator()
int getNumberOfParents()
ChoiceGenerator<T> randomize()
ChoiceGenerator<?> clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
ChoiceGenerator<?> deepClone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
java.lang.String getId()
int getIdRef()
void setIdRef(int idRef)
void setId(java.lang.String id)
boolean isSchedulingPoint()
void setThreadInfo(ThreadInfo ti)
ThreadInfo getThreadInfo()
void setInsn(Instruction insn)
Instruction getInsn()
void setContext(ThreadInfo tiCreator)
void setStateId(int stateId)
int getStateId()
java.lang.String getSourceLocation()
boolean supportsReordering()
ChoiceGenerator<T> reorder(java.util.Comparator<T> comparator)
void setPreviousChoiceGenerator(ChoiceGenerator<?> cg)
void setCascaded()
boolean isCascaded()
<T extends ChoiceGenerator<?>> T getPreviousChoiceGeneratorOfType(java.lang.Class<T> cls)
ChoiceGenerator<?> getCascadedParent()
ChoiceGenerator<?>[] getCascade()
ChoiceGenerator<?>[] getAll()
<C extends ChoiceGenerator<?>> C[] getAllOfType(java.lang.Class<C> cgType)
boolean hasAttr()
boolean hasAttr(java.lang.Class<?> attrType)
java.lang.Object getAttr()
void setAttr(java.lang.Object a)
void addAttr(java.lang.Object a)
void removeAttr(java.lang.Object a)
void replaceAttr(java.lang.Object oldAttr, java.lang.Object newAttr)
<A> A getAttr(java.lang.Class<A> attrType)
<A> A getNextAttr(java.lang.Class<A> attrType, java.lang.Object prev)
ObjectList.Iterator attrIterator()
<A> ObjectList.TypedIterator<A> attrIterator(java.lang.Class<A> attrType)