Package tilda.utils
Class RandomUtil
- java.lang.Object
-
- tilda.utils.RandomUtil
-
public class RandomUtil extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.Random_R
-
Constructor Summary
Constructors Constructor Description RandomUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanflip()static booleanpick(double Odds)picks a random number and returns true if that is < Odds, or false otherwise.static doublepick(double Min, double Max)static intpick(int Min, int Max)static <T> Tpick(java.util.List<T> L)static <T> Tpick(T[] A)static shortpickNonZeroShort()
-
-
-
Method Detail
-
flip
public static boolean flip()
-
pick
public static <T> T pick(java.util.List<T> L)
-
pick
public static <T> T pick(T[] A)
-
pick
public static int pick(int Min, int Max)
-
pick
public static boolean pick(double Odds)
picks a random number and returns true if that is < Odds, or false otherwise. So, calling with 0.75 means a 75% chance true Vs. false- Parameters:
Odds- a number between 0 and 1- Returns:
-
pick
public static double pick(double Min, double Max)
-
pickNonZeroShort
public static short pickNonZeroShort()
-
-