|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object standup.utils.Utils
public class Utils
A collection of various low-level utility functions, all accessible from a static context.
Field Summary | |
---|---|
private static Random |
dice
|
private static int |
fODD_PRIME_NUMBER
|
static int |
SEED
An initial value for a hashCode , to which is added
contributions from fields. |
Constructor Summary | |
---|---|
Utils()
|
Method Summary | ||
---|---|---|
static void |
copy(InputStream in,
File dst)
|
|
static
|
copyList(List<T> orig)
|
|
private static int |
firstTerm(int aSeed)
|
|
static
|
getRandom(Collection<T> stuff)
|
|
static String |
getTimeString(long timeStamp)
|
|
static int |
hash(int aSeed,
boolean aBoolean)
booleans. |
|
static int |
hash(int aSeed,
char aChar)
chars. |
|
static int |
hash(int aSeed,
double aDouble)
doubles. |
|
static int |
hash(int aSeed,
float aFloat)
floats. |
|
static int |
hash(int aSeed,
int aInt)
ints. |
|
static int |
hash(int aSeed,
long aLong)
longs. |
|
static int |
hash(int aSeed,
Object aObject)
aObject is a possibly-null object field, and possibly an
array. |
|
private static boolean |
isArray(Object aObject)
|
|
static
|
removeRandom(Collection<T> stuff)
|
|
static double |
throwDice()
|
|
static int |
throwDice(int max)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static Random dice
public static final int SEED
hashCode
, to which is added
contributions from fields. Using a non-zero value decreases collisons of
hashCode
values.
private static final int fODD_PRIME_NUMBER
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static String getTimeString(long timeStamp)
public static void copy(InputStream in, File dst) throws IOException
IOException
public static double throwDice()
public static int throwDice(int max)
public static <T> T getRandom(Collection<T> stuff)
public static <T> T removeRandom(Collection<T> stuff)
public static <T> List<T> copyList(List<T> orig)
public static int hash(int aSeed, boolean aBoolean)
public static int hash(int aSeed, char aChar)
public static int hash(int aSeed, int aInt)
public static int hash(int aSeed, long aLong)
public static int hash(int aSeed, float aFloat)
public static int hash(int aSeed, double aDouble)
public static int hash(int aSeed, Object aObject)
aObject
is a possibly-null object field, and possibly an
array.
If aObject
is an array, then each element may be a
primitive or a possibly-null object.
private static int firstTerm(int aSeed)
private static boolean isArray(Object aObject)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |