org.statcato.random
Class BinomialSample

java.lang.Object
  extended by java.util.Random
      extended by org.statcato.random.BinomialSample
All Implemented Interfaces:
java.io.Serializable

public class BinomialSample
extends java.util.Random

A random sampler for a binomial distribution defined by the number of trials and event probability.

Since:
1.0
Version:
%I%, %G%
Author:
Margaret Yau
See Also:
Serialized Form

Constructor Summary
BinomialSample(int trials, double probability)
          Constructor.
 
Method Summary
 int nextSample()
          Returns the next random sample
 
Methods inherited from class java.util.Random
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextInt, nextLong, setSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinomialSample

public BinomialSample(int trials,
                      double probability)
Constructor.

Parameters:
trials - number of trials
probability - event probability
Method Detail

nextSample

public int nextSample()
Returns the next random sample

Returns:
int number of successes