|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.data.RandomLib
public class RandomLib
Various games of chance.
Uses a single Random for generation, except where noted.
Don't trust this for cryptographic purposes; if you need to be sure of the security your random numbers, generate your own. The underlying implementation of this class may change if performance or other considerations dictate.
Copyright 2005-2006 Partner Software, Inc.
| Method Summary | |
|---|---|
static boolean |
randomBoolean()
Generates a random true/false result. |
static byte[] |
randomBytes(int size)
Generates a String of the given length consisting of random digits. |
static int |
randomDigit()
randoms a single digit 0-9 inclusive. |
static java.lang.String |
randomGuid()
Generates a random GUID. |
static int |
randomInt(int limit)
Generates a random integer between 0 <= result < limit |
static int |
randomInt(int min,
int max)
Generates a random integer between the two bounds such that min <= result <= max. |
static byte[] |
randomLengthBytes(int maxSize)
Generates a random-length String consisting of random digits, up to the given length. |
static java.lang.String |
randomLengthStringOfDigits(int maxSize)
Generates a random-length String consisting of random digits, up to the given length. |
static int |
randomNonZeroDigit()
Generates a single random digit 1-9 inclusive. |
static java.lang.String |
randomPhoneNumber()
Generates a random phone number. |
static java.lang.Object |
randomPick(java.util.Collection options)
Picks a random item out of a Collection. |
static java.lang.Object |
randomRemove(java.util.Collection options)
Removes a random item from a Collection. |
static java.lang.String |
randomStringOfDigits(int size)
Generates a String of the given length consisting of random digits. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int randomInt(int limit)
public static int randomInt(int min,
int max)
public static int randomDigit()
public static int randomNonZeroDigit()
public static java.lang.String randomPhoneNumber()
public static java.lang.Object randomPick(java.util.Collection options)
public static java.lang.Object randomRemove(java.util.Collection options)
public static java.lang.String randomGuid()
UUID.randomUUID(); the
only difference is that it surrounds the GUID string with curly braces ({
and }). This is for interoperability with PDA/Origin GIS GUIDs (which use
a Microsoft standard, I believe).
public static java.lang.String randomLengthStringOfDigits(int maxSize)
public static java.lang.String randomStringOfDigits(int size)
public static byte[] randomLengthBytes(int maxSize)
public static byte[] randomBytes(int size)
public static boolean randomBoolean()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||