You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ps...@apache.org on 2005/08/30 01:48:24 UTC

svn commit: r264659 - /jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/random/RandomAdaptor.java

Author: psteitz
Date: Mon Aug 29 16:48:21 2005
New Revision: 264659

URL: http://svn.apache.org/viewcvs?rev=264659&view=rev
Log:
Javadoc.

Modified:
    jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/random/RandomAdaptor.java

Modified: jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/random/RandomAdaptor.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/random/RandomAdaptor.java?rev=264659&r1=264658&r2=264659&view=diff
==============================================================================
--- jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/random/RandomAdaptor.java (original)
+++ jakarta/commons/proper/math/branches/MATH_1_1/src/java/org/apache/commons/math/random/RandomAdaptor.java Mon Aug 29 16:48:21 2005
@@ -54,64 +54,118 @@
         return new RandomAdaptor(randomGenerator);
     }
     
-    /* (non-Javadoc)
-     * @see java.util.Random#nextBoolean()
+    /**
+     * Returns the next pseudorandom, uniformly distributed
+     * <code>boolean</code> value from this random number generator's
+     * sequence.  
+     * 
+     * @return  the next pseudorandom, uniformly distributed
+     * <code>boolean</code> value from this random number generator's
+     * sequence
      */
     public boolean nextBoolean() {
         return randomGenerator.nextBoolean();
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#nextBytes(byte[])
+     /**
+     * Generates random bytes and places them into a user-supplied 
+     * byte array.  The number of random bytes produced is equal to 
+     * the length of the byte array.
+     * 
+     * @param bytes the non-null byte array in which to put the 
+     * random bytes
      */
     public void nextBytes(byte[] bytes) {
         randomGenerator.nextBytes(bytes);
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#nextDouble()
-     */
+     /**
+     * Returns the next pseudorandom, uniformly distributed 
+     * <code>double</code> value between <code>0.0</code> and
+     * <code>1.0</code> from this random number generator's sequence.  
+     *
+     * @return  the next pseudorandom, uniformly distributed 
+     *  <code>double</code> value between <code>0.0</code> and
+     *  <code>1.0</code> from this random number generator's sequence
+     */  
     public double nextDouble() {
         return randomGenerator.nextDouble();
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#nextFloat()
+    /**
+     * Returns the next pseudorandom, uniformly distributed <code>float</code>
+     * value between <code>0.0</code> and <code>1.0</code> from this random
+     * number generator's sequence.  
+     *
+     * @return  the next pseudorandom, uniformly distributed <code>float</code>
+     * value between <code>0.0</code> and <code>1.0</code> from this
+     * random number generator's sequence
      */
     public float nextFloat() {
         return randomGenerator.nextFloat();
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#nextGaussian()
+    /**
+     * Returns the next pseudorandom, Gaussian ("normally") distributed
+     * <code>double</code> value with mean <code>0.0</code> and standard
+     * deviation <code>1.0</code> from this random number generator's sequence.
+     * 
+     * @return  the next pseudorandom, Gaussian ("normally") distributed
+     * <code>double</code> value with mean <code>0.0</code> and
+     * standard deviation <code>1.0</code> from this random number
+     *  generator's sequence
      */
     public double nextGaussian() {
         return randomGenerator.nextGaussian();
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#nextInt()
+     /**
+     * Returns the next pseudorandom, uniformly distributed <code>int</code>
+     * value from this random number generator's sequence.  
+     * All 2<font size="-1"><sup>32</sup></font> possible <tt>int</tt> values
+     * should be produced with  (approximately) equal probability. 
+     *
+     * @return the next pseudorandom, uniformly distributed <code>int</code>
+     *  value from this random number generator's sequence
      */
     public int nextInt() {
         return randomGenerator.nextInt();
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#nextInt(int)
+    /**
+     * Returns a pseudorandom, uniformly distributed <tt>int</tt> value
+     * between 0 (inclusive) and the specified value (exclusive), drawn from
+     * this random number generator's sequence.   
+     *
+     * @param n the bound on the random number to be returned.  Must be
+     * positive.
+     * @return  a pseudorandom, uniformly distributed <tt>int</tt>
+     * value between 0 (inclusive) and n (exclusive).
+     * @throws IllegalArgumentException  if n is not positive.
      */
     public int nextInt(int n) {
         return randomGenerator.nextInt(n);
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#nextLong()
+    /**
+     * Returns the next pseudorandom, uniformly distributed <code>long</code>
+     * value from this random number generator's sequence.  All 
+     * 2<font size="-1"><sup>64</sup></font> possible <tt>long</tt> values 
+     * should be produced with (approximately) equal probability. 
+     *
+     * @return  the next pseudorandom, uniformly distributed <code>long</code>
+     *value from this random number generator's sequence
      */
     public long nextLong() {
         return randomGenerator.nextLong();
     }
 
-    /* (non-Javadoc)
-     * @see java.util.Random#setSeed(long)
+    /**
+     * Sets the seed of the underyling random number generator using a 
+     * <code>long</code> seed.  Sequences of values generated starting with the
+     * same seeds should be identical.
+     *
+     * @param seed the seed value
      */
     public void setSeed(long seed) {
         if (randomGenerator != null) {  // required to avoid NPE in constructor



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org