net.sf.jga.fn.adaptor
Class Random
java.lang.Object
net.sf.jga.fn.Functor<R>
net.sf.jga.fn.Generator<java.lang.Double>
net.sf.jga.fn.adaptor.Random
- All Implemented Interfaces:
- java.io.Serializable, Visitable
public class Random
- extends Generator<java.lang.Double>
Functor that returns a pseudorandom value using Math.random(). Additional
implementations are left as an exercise...
Copyright © 2004-2005 David A. Hall
- Author:
- David A. Hall
- See Also:
- Serialized Form
Nested Class Summary |
static interface |
Random.Visitor
Interface for classes that may interpret a Random generator. |
Method Summary |
void |
accept(Visitor v)
Calls the Visitor's visit(Random) method, if it
implements the nested Visitor interface. |
java.lang.Double |
fn()
Returns a pseudorandom value, using Math.random(). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Random
public Random()
fn
public java.lang.Double fn()
- Returns a pseudorandom value, using Math.random().
- Specified by:
fn
in class Generator<java.lang.Double>
- Returns:
- a pseudorandom value
accept
public void accept(Visitor v)
- Calls the Visitor's
visit(Random)
method, if it
implements the nested Visitor interface.
- Specified by:
accept
in interface Visitable
- Overrides:
accept
in class Functor<java.lang.Double>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2002-2006 David A. Hall. All Rights Reserved.