org.datamixer.functions
Class RandomFunction

java.lang.Object
  extended byorg.datamixer.collections.DatamixerIterator
      extended byorg.datamixer.functions.RandomFunction
All Implemented Interfaces:
DatamixerEventGenerator, java.util.Iterator

public class RandomFunction
extends DatamixerIterator

RandomFunction returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0.


Field Summary
protected  double current_
          the current value
protected  java.util.Random random_
          random number generator
protected  long seed_
          seed for random number generator
 
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
RandomFunction()
           
 
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.
 java.text.Format getFormat(java.lang.String pattern)
          Returns an appropriate Format object.
 long getSeed()
           
 void setSeed(long value)
           
 
Methods inherited from class org.datamixer.collections.DatamixerIterator
addDatamixerListener, doFireDatamixerEvent, doInitialize, doReset, fireDatamixerEvent, generate, getCollection, getContainer, getCurrent, getCurrentValue, getDataType, 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

current_

protected double current_
the current value


random_

protected java.util.Random random_
random number generator


seed_

protected long seed_
seed for random number generator

Constructor Detail

RandomFunction

public RandomFunction()
Method Detail

doGetCurrentValue

protected Value doGetCurrentValue()
Returns the current value.

Specified by:
doGetCurrentValue in class DatamixerIterator
Returns:
the current value.

getFormat

public java.text.Format getFormat(java.lang.String pattern)
Returns an appropriate Format object.

Overrides:
getFormat in class DatamixerIterator

doDone

protected boolean doDone()
                  throws DatamixerException
Description copied from class: DatamixerIterator
Returns false, always.

Overrides:
doDone in class DatamixerIterator
Throws:
DatamixerException

doGenerate

protected void doGenerate()
                   throws DatamixerException
Description copied from class: DatamixerIterator
Generate the next element in the collection.

Overrides:
doGenerate in class DatamixerIterator
Throws:
DatamixerException

getSeed

public long getSeed()

setSeed

public void setSeed(long value)


Copyright © 2004-2006 datamixer.org. All Rights Reserved.