Minor Javadoc corrections.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1580464 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Duncan Jones 2014-03-23 07:28:42 +00:00
parent 863bf52eae
commit 708da45999
1 changed files with 25 additions and 10 deletions

View File

@ -19,7 +19,7 @@
import java.util.Random; import java.util.Random;
/** /**
* Utility library that supplements the standard {@link Random} class. * <p>Utility library that supplements the standard {@link Random} class.</p>
* *
* @since 3.3 * @since 3.3
* *
@ -50,11 +50,14 @@ public RandomUtils() {
} }
/** /**
* Creates a array of the specified length filled with random bytes. * <p>
* Creates an array of random bytes.
* </p>
* *
* @param count * @param count
* the size of the returned array * the size of the returned array
* @return the random byte array * @return the random byte array
* @throws IllegalArgumentException if {@code count} is negative
*/ */
public static byte[] nextBytes(int count) { public static byte[] nextBytes(int count) {
Validate.isTrue(count >= 0, "Count cannot be negative."); Validate.isTrue(count >= 0, "Count cannot be negative.");
@ -65,14 +68,17 @@ public static byte[] nextBytes(int count) {
} }
/** /**
* <p>
* Returns a random integer within the specified range. * Returns a random integer within the specified range.
* </p>
* *
* @param startInclusive * @param startInclusive
* the smallest value that can be returned, must be non-negative * the smallest value that can be returned, must be non-negative
* @param endExclusive * @param endExclusive
* the upper bound (not included), must be non-negative * the upper bound (not included)
* @throws IllegalArgumentException * @throws IllegalArgumentException
* if {@code startInclusive > endInclusive} * if {@code startInclusive > endExclusive} or if
* {@code startInclusive} is negative
* @return the random integer * @return the random integer
*/ */
public static int nextInt(int startInclusive, int endExclusive) { public static int nextInt(int startInclusive, int endExclusive) {
@ -88,14 +94,17 @@ public static int nextInt(int startInclusive, int endExclusive) {
} }
/** /**
* <p>
* Returns a random long within the specified range. * Returns a random long within the specified range.
* </p>
* *
* @param startInclusive * @param startInclusive
* the smallest value that can be returned, must be non-negative * the smallest value that can be returned, must be non-negative
* @param endExclusive * @param endExclusive
* the upper bound (not included), must be non-negative * the upper bound (not included)
* @throws IllegalArgumentException * @throws IllegalArgumentException
* if {@code startInclusive > endInclusive} * if {@code startInclusive > endExclusive} or if
* {@code startInclusive} is negative
* @return the random long * @return the random long
*/ */
public static long nextLong(long startInclusive, long endExclusive) { public static long nextLong(long startInclusive, long endExclusive) {
@ -112,14 +121,17 @@ public static long nextLong(long startInclusive, long endExclusive) {
/** /**
* <p>
* Returns a random double within the specified range. * Returns a random double within the specified range.
* </p>
* *
* @param startInclusive * @param startInclusive
* the smallest value that can be returned, must be non-negative * the smallest value that can be returned, must be non-negative
* @param endInclusive * @param endInclusive
* the upper bound (included), must be non-negative * the upper bound (included)
* @throws IllegalArgumentException * @throws IllegalArgumentException
* if {@code startInclusive > endInclusive} * if {@code startInclusive > endInclusive} or if
* {@code startInclusive} is negative
* @return the random double * @return the random double
*/ */
public static double nextDouble(double startInclusive, double endInclusive) { public static double nextDouble(double startInclusive, double endInclusive) {
@ -135,14 +147,17 @@ public static double nextDouble(double startInclusive, double endInclusive) {
} }
/** /**
* <p>
* Returns a random float within the specified range. * Returns a random float within the specified range.
* </p>
* *
* @param startInclusive * @param startInclusive
* the smallest value that can be returned, must be non-negative * the smallest value that can be returned, must be non-negative
* @param endInclusive * @param endInclusive
* the upper bound (included), must be non-negative * the upper bound (included)
* @throws IllegalArgumentException * @throws IllegalArgumentException
* if {@code startInclusive > endInclusive} * if {@code startInclusive > endInclusive} or if
* {@code startInclusive} is negative
* @return the random float * @return the random float
*/ */
public static float nextFloat(float startInclusive, float endInclusive) { public static float nextFloat(float startInclusive, float endInclusive) {