-
public final class RandomExtensions
-
-
Method Summary
Modifier and Type Method Description final static BytenextByte(Random $self)得到随机的字节。 final static BytenextByte(Random $self, Byte until)得到随机的字节。 final static BytenextByte(Random $self, Byte from, Byte until)得到随机的字节。 final static ShortnextShort(Random $self)得到随机的短整数。 final static ShortnextShort(Random $self, Short until)得到随机的短整数。 final static ShortnextShort(Random $self, Short from, Short until)得到随机的短整数。 final static FloatnextFloat(Random $self, Float until)得到随机的单精度浮点数。 final static FloatnextFloat(Random $self, Float from, Float until)得到随机的单精度浮点数。 final static CharacternextChar(Random $self)得到随机的字符。 final static CharacternextChar(Random $self, Character until)得到随机的字符。 final static CharacternextChar(Random $self, Character from, Character until)得到随机的字符。 final static BigIntegernextBigInteger(Random $self)得到随机的大整数。 final static BigIntegernextBigInteger(Random $self, BigInteger until)得到随机的大整数。 final static BigIntegernextBigInteger(Random $self, BigInteger from, BigInteger until)得到随机的大整数。 final static BigDecimalnextBigDecimal(Random $self, MathContext mathContext)得到随机的大数字。 final static BigDecimalnextBigDecimal(Random $self, BigDecimal until, MathContext mathContext)得到随机的大数字。 final static BigDecimalnextBigDecimal(Random $self, BigDecimal from, BigDecimal until, MathContext mathContext)得到随机的大数字。 final static UBytenextUByte(Random $self)得到随机的无符号字节。 final static UBytenextUByte(Random $self, UByte until)得到随机的无符号字节。 final static UBytenextUByte(Random $self, UByte from, UByte until)得到随机的无符号字节。 final static UShortnextUShort(Random $self)得到随机的无符号短整数。 final static UShortnextUShort(Random $self, UShort until)得到随机的无符号短整数。 final static UShortnextUShort(Random $self, UShort from, UShort until)得到随机的无符号短整数。 final static StringnextString(Random $self, String source, Integer length)得到由source中的字符组成的长度为length的字符串。 final static UUIDnextUuid(Random $self)得到随机的UUID。 final static StringnextUuidString(Random $self)得到随机的UUID字符串。 final static CharacternextElement(Random $self, String string)得到随机的字符。 final static CharacternextElement(Random $self, CharArray elements)得到随机的元素。 final static <T extends Any> TnextElement(Random $self, Array<out T> elements)得到随机的元素。 final static <T extends Any> TnextElement(Random $self, List<T> elements)得到随机的元素。 final static BooleancheckChance(Random $self, Float chance)检查一个几率发生的事件是否发生。 final static BooleancheckChance(Random $self, Float chance, Boolean condition)检查一个几率发生的事件是否发生,附带额外条件。 final static BooleancheckChance(Random $self, Float chance, Function0<Boolean> predicate)检查一个几率发生的事件是否发生,附带额外条件。 -
-
Method Detail
-
nextBigInteger
final static BigInteger nextBigInteger(Random $self)
得到随机的大整数。
-
nextBigInteger
final static BigInteger nextBigInteger(Random $self, BigInteger until)
得到随机的大整数。
-
nextBigInteger
final static BigInteger nextBigInteger(Random $self, BigInteger from, BigInteger until)
得到随机的大整数。
-
nextBigDecimal
final static BigDecimal nextBigDecimal(Random $self, MathContext mathContext)
得到随机的大数字。
-
nextBigDecimal
final static BigDecimal nextBigDecimal(Random $self, BigDecimal until, MathContext mathContext)
得到随机的大数字。
-
nextBigDecimal
final static BigDecimal nextBigDecimal(Random $self, BigDecimal from, BigDecimal until, MathContext mathContext)
得到随机的大数字。
-
nextUShort
final static UShort nextUShort(Random $self)
得到随机的无符号短整数。
-
nextUShort
final static UShort nextUShort(Random $self, UShort until)
得到随机的无符号短整数。
-
nextUShort
final static UShort nextUShort(Random $self, UShort from, UShort until)
得到随机的无符号短整数。
-
nextString
final static String nextString(Random $self, String source, Integer length)
得到由source中的字符组成的长度为length的字符串。
-
nextUuidString
final static String nextUuidString(Random $self)
得到随机的UUID字符串。
-
nextElement
final static Character nextElement(Random $self, String string)
得到随机的字符。
-
nextElement
final static Character nextElement(Random $self, CharArray elements)
得到随机的元素。
-
nextElement
final static <T extends Any> T nextElement(Random $self, Array<out T> elements)
得到随机的元素。
-
nextElement
final static <T extends Any> T nextElement(Random $self, List<T> elements)
得到随机的元素。
-
checkChance
final static Boolean checkChance(Random $self, Float chance)
检查一个几率发生的事件是否发生。
-
checkChance
final static Boolean checkChance(Random $self, Float chance, Boolean condition)
检查一个几率发生的事件是否发生,附带额外条件。
-
checkChance
final static Boolean checkChance(Random $self, Float chance, Function0<Boolean> predicate)
检查一个几率发生的事件是否发生,附带额外条件。
-
-
-
-