|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.datamixer.collections.DatamixerIterator
org.datamixer.collections.RandomIterator
| Field Summary | |
protected int |
count_
the number of indexes that have been chosen |
protected Value |
current_
current value |
protected DatamixerList |
list_
the associated list |
protected java.util.Random |
random_
random number generator |
protected int[] |
remaining_
array to hold indexes of remaining values, when selecting without replacement |
protected boolean |
replace_
select with replacement if true |
protected long |
seed_
seed for random number generator |
protected int |
size_
the collection size |
| Fields inherited from class org.datamixer.collections.DatamixerIterator |
collection_, debugEnabled_, done_, doneChecked_, doneListeners_, format_, formatPattern_, id_, infoEnabled_, initialized_, logger_, name_, nextListeners_, path_, repeat_, repeatSet_ |
| Constructor Summary | |
RandomIterator()
|
|
| Method Summary | |
protected boolean |
doDone()
Returns false, always. |
protected void |
doGenerate()
Generate the next element in the collection. |
protected Value |
doGetCurrentValue()
Returns the current value. |
protected void |
doInitialize()
Initialization. |
protected void |
doReset()
Resets the iterator to an initial state. |
int |
getDataType()
Returns the datatype. |
java.text.Format |
getFormat(java.lang.String pattern)
Returns an appropriate Format object. |
boolean |
getReplace()
|
long |
getSeed()
|
protected int |
randomIndex()
Choose a random index. |
void |
setReplace(boolean value)
|
void |
setSeed(long value)
|
protected void |
updateRemaining()
Resets the iterator to an initial state. |
| Methods inherited from class org.datamixer.collections.DatamixerIterator |
addDatamixerListener, doFireDatamixerEvent, fireDatamixerEvent, generate, getCollection, getContainer, getCurrent, getCurrentValue, getFormatPattern, getHasNext, getId, getListeners, getName, getNext, getNextValue, getPath, getRepeat, hasNext, initialize, next, remove, removeDatamixerListener, reset, setCollection, setContainer, setCurrentValue, setDataType, setFormatPattern, setId, setName, setRepeat, toString, updateCurrentValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected DatamixerList list_
protected java.util.Random random_
protected long seed_
protected boolean replace_
protected int size_
protected Value current_
protected int count_
protected int[] remaining_
| Constructor Detail |
public RandomIterator()
| Method Detail |
public int getDataType()
getDataType in class DatamixerIteratorprotected Value doGetCurrentValue()
doGetCurrentValue in class DatamixerIteratorpublic java.text.Format getFormat(java.lang.String pattern)
getFormat in class DatamixerIterator
protected void doInitialize()
throws DatamixerException
doInitialize in class DatamixerIteratorDatamixerException
protected boolean doDone()
throws DatamixerException
DatamixerIteratorfalse, always.
doDone in class DatamixerIteratorDatamixerException
protected void doGenerate()
throws DatamixerException
DatamixerIterator
doGenerate in class DatamixerIteratorDatamixerException
protected void doReset()
throws DatamixerException
doReset in class DatamixerIteratorDatamixerExceptionpublic long getSeed()
public void setSeed(long value)
public boolean getReplace()
public void setReplace(boolean value)
protected int randomIndex()
protected void updateRemaining()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||