loanfund
Class Randomizer

java.lang.Object
  extended by loanfund.Randomizer

public class Randomizer
extends java.lang.Object

This class is used to create unique identifiers. The probability of two identifiers being identical should be 1/P_GOAL.

Author:
Gunn Olaussen & Kirsti N. Torgersen

Field Summary
private static long P_GOAL
           
private static java.security.SecureRandom rand
           
private static char[] values
           
 
Constructor Summary
Randomizer()
           
 
Method Summary
static java.lang.String nextID()
          This method uses the default Random object to generate a unique number of appropriate length to satisfy the probability goal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_GOAL

private static final long P_GOAL
See Also:
Constant Field Values

rand

private static java.security.SecureRandom rand

values

private static char[] values
Constructor Detail

Randomizer

public Randomizer()
Method Detail

nextID

public static java.lang.String nextID()
This method uses the default Random object to generate a unique number of appropriate length to satisfy the probability goal.

Returns:
String A new message ID.