net.sf.farrago.rng
Class FarragoRngUDR

java.lang.Object
  extended by net.sf.farrago.rng.FarragoRngUDR

public abstract class FarragoRngUDR
extends Object

FarragoRngUDR contains implementations for the user-defined routine portion of the RNG plugin example.

Version:
$Id: //open/dev/farrago/examples/rng/src/net/sf/farrago/rng/FarragoRngUDR.java#14 $
Author:
John V. Sichi

Field Summary
private static Logger tracer
           
 
Constructor Summary
FarragoRngUDR()
           
 
Method Summary
(package private) static String getFilename(RngRandomNumberGenerator rng)
           
static RngmodelPackage getRngModelPackage(FarragoRepos repos)
           
static Random readSerialized(File file)
           
static int rng_next_int_internal(int n, String rngName, String filename)
          Generates the next pseudo-random integer from a particular RNG.
static int rng_next_int(String rngName, int n)
          Generates the next pseudo-random integer from a particular RNG.
static void writeSerialized(File file, Random random)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

private static final Logger tracer
Constructor Detail

FarragoRngUDR

public FarragoRngUDR()
Method Detail

rng_next_int

public static int rng_next_int(String rngName,
                               int n)
                        throws SQLException
Generates the next pseudo-random integer from a particular RNG.

Parameters:
rngName - name of the RNG (possibly qualified)
n - upper limit on generated nonnegative integer, or -1 for unlimited (including negative)
Throws:
SQLException

rng_next_int_internal

public static int rng_next_int_internal(int n,
                                        String rngName,
                                        String filename)
                                 throws SQLException
Generates the next pseudo-random integer from a particular RNG.

Parameters:
n - upper limit on generated nonnegative integer, or -1 for unlimited (including negative)
rngName - fully-qualified name of the RNG
filename - name of the RNG's datafile
Returns:
psuedo-random integer
Throws:
SQLException

getRngModelPackage

public static RngmodelPackage getRngModelPackage(FarragoRepos repos)

writeSerialized

public static void writeSerialized(File file,
                                   Random random)
                            throws IOException
Throws:
IOException

readSerialized

public static Random readSerialized(File file)
                             throws Exception
Throws:
Exception

getFilename

static String getFilename(RngRandomNumberGenerator rng)