com.limegroup.gnutella.util
Class Random12

java.lang.Object
  extended byjava.util.Random
      extended bycom.limegroup.gnutella.util.Random12
All Implemented Interfaces:
java.io.Serializable

public class Random12
extends java.util.Random

A subclass of Random that provides the convenient nextInt(n) method from Java 1.2 and later. Useful for compatibility with Java 1.1.8 on the Macintosh. Subclassing is necessary to gain access to the protected next(int) method.

See Also:
Serialized Form

Constructor Summary
Random12()
           
Random12(long seed)
           
 
Method Summary
 int nextInt(int n)
          Returns a random number from 0 (inclusive) to n (exclusive).
 
Methods inherited from class java.util.Random
next, nextBoolean, nextBytes, nextDouble, nextFloat, nextGaussian, nextInt, nextLong, setSeed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Random12

public Random12()

Random12

public Random12(long seed)
Method Detail

nextInt

public int nextInt(int n)
            throws java.lang.IllegalArgumentException
Returns a random number from 0 (inclusive) to n (exclusive). Same as nextInt(n) in Java 1.2 and later.

Parameters:
n - the largest value allowed plus one
Throws:
java.lang.IllegalArgumentException - n is less than one