From 708da45999d8e545bfbae17a092c68df94061756 Mon Sep 17 00:00:00 2001 From: Duncan Jones Date: Sun, 23 Mar 2014 07:28:42 +0000 Subject: [PATCH] Minor Javadoc corrections. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1580464 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/commons/lang3/RandomUtils.java | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/RandomUtils.java b/src/main/java/org/apache/commons/lang3/RandomUtils.java index eccee383d..c540e7222 100644 --- a/src/main/java/org/apache/commons/lang3/RandomUtils.java +++ b/src/main/java/org/apache/commons/lang3/RandomUtils.java @@ -19,7 +19,7 @@ import java.util.Random; /** - * Utility library that supplements the standard {@link Random} class. + *

Utility library that supplements the standard {@link Random} class.

* * @since 3.3 * @@ -50,11 +50,14 @@ public RandomUtils() { } /** - * Creates a array of the specified length filled with random bytes. + *

+ * Creates an array of random bytes. + *

* * @param count * the size of the returned array * @return the random byte array + * @throws IllegalArgumentException if {@code count} is negative */ public static byte[] nextBytes(int count) { Validate.isTrue(count >= 0, "Count cannot be negative."); @@ -65,14 +68,17 @@ public static byte[] nextBytes(int count) { } /** + *

* Returns a random integer within the specified range. + *

* * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endExclusive - * the upper bound (not included), must be non-negative + * the upper bound (not included) * @throws IllegalArgumentException - * if {@code startInclusive > endInclusive} + * if {@code startInclusive > endExclusive} or if + * {@code startInclusive} is negative * @return the random integer */ public static int nextInt(int startInclusive, int endExclusive) { @@ -88,14 +94,17 @@ public static int nextInt(int startInclusive, int endExclusive) { } /** + *

* Returns a random long within the specified range. + *

* * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endExclusive - * the upper bound (not included), must be non-negative + * the upper bound (not included) * @throws IllegalArgumentException - * if {@code startInclusive > endInclusive} + * if {@code startInclusive > endExclusive} or if + * {@code startInclusive} is negative * @return the random long */ public static long nextLong(long startInclusive, long endExclusive) { @@ -112,14 +121,17 @@ public static long nextLong(long startInclusive, long endExclusive) { /** + *

* Returns a random double within the specified range. + *

* * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endInclusive - * the upper bound (included), must be non-negative + * the upper bound (included) * @throws IllegalArgumentException - * if {@code startInclusive > endInclusive} + * if {@code startInclusive > endInclusive} or if + * {@code startInclusive} is negative * @return the random double */ public static double nextDouble(double startInclusive, double endInclusive) { @@ -135,14 +147,17 @@ public static double nextDouble(double startInclusive, double endInclusive) { } /** + *

* Returns a random float within the specified range. + *

* * @param startInclusive * the smallest value that can be returned, must be non-negative * @param endInclusive - * the upper bound (included), must be non-negative + * the upper bound (included) * @throws IllegalArgumentException - * if {@code startInclusive > endInclusive} + * if {@code startInclusive > endInclusive} or if + * {@code startInclusive} is negative * @return the random float */ public static float nextFloat(float startInclusive, float endInclusive) {