Class RandomPicks
java.lang.Object
com.carrotsearch.randomizedtesting.generators.RandomPicks
Random selections of objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
checkZeroLength
(int length) static byte
randomFrom
(Random r, byte[] array) static char
randomFrom
(Random r, char[] array) static double
randomFrom
(Random r, double[] array) static float
randomFrom
(Random r, float[] array) static int
randomFrom
(Random r, int[] array) static long
randomFrom
(Random r, long[] array) static short
randomFrom
(Random r, short[] array) static <T> T
randomFrom
(Random r, Collection<T> collection) Pick a random object from the collection.static <T> T
randomFrom
(Random r, List<T> list) Pick a random object from the given list.static <T> T
randomFrom
(Random r, T[] array) Pick a random object from the given array.
-
Constructor Details
-
RandomPicks
public RandomPicks()
-
-
Method Details
-
randomFrom
-
randomFrom
-
randomFrom
-
randomFrom
-
randomFrom
-
randomFrom
-
randomFrom
-
checkZeroLength
private static void checkZeroLength(int length) -
randomFrom
Pick a random object from the given array. -
randomFrom
Pick a random object from the given list. -
randomFrom
Pick a random object from the collection. Requires linear scanning.
-