|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.util.Utils
public class Utils
Collection of small static helper methods.
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | ||
|---|---|---|
static boolean |
equals(java.lang.Object one,
java.lang.Object two)
Will check if both objects are equal but also checks for null. |
|
static
|
getRandomMember(java.util.logging.Logger logger,
java.lang.String logMe,
java.util.List<T> list,
java.util.Random random)
Gets a random member of a list. |
|
static java.lang.String |
getUserDirectory()
Generalize this method instead of calling it directly elsewhere. |
|
static java.lang.String |
join(java.lang.String delimiter,
java.util.List<java.lang.String> strings)
Joins the given strings. |
|
static java.lang.String |
join(java.lang.String delimiter,
java.lang.String... strings)
Joins the given strings. |
|
static double |
randomDouble(java.util.logging.Logger logger,
java.lang.String logMe,
java.util.Random random)
Convenience to aid logging uses of Randoms. |
|
static int |
randomInt(java.util.logging.Logger logger,
java.lang.String logMe,
java.util.Random random,
int n)
Convenience to aid logging uses of Randoms. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static java.lang.String join(java.lang.String delimiter,
java.lang.String... strings)
delimiter - The delimiter to place between the individual strings.strings - The strings to be joined.
public static java.lang.String join(java.lang.String delimiter,
java.util.List<java.lang.String> strings)
delimiter - The delimiter to place between the individual strings.strings - The strings to be joined.
public static boolean equals(java.lang.Object one,
java.lang.Object two)
one - First object to comparetwo - Second object to compare
(one == null && two != null) || (one != null && one.equals(two))public static java.lang.String getUserDirectory()
public static int randomInt(java.util.logging.Logger logger,
java.lang.String logMe,
java.util.Random random,
int n)
logger - The Logger to log to.logMe - A string to log with the result.random - A pseudo-Random number source.n - The exclusive maximum integer to return.
public static double randomDouble(java.util.logging.Logger logger,
java.lang.String logMe,
java.util.Random random)
logger - The Logger to log to.logMe - A string to log with the result.random - A pseudo-Random number source.
public static <T> T getRandomMember(java.util.logging.Logger logger,
java.lang.String logMe,
java.util.List<T> list,
java.util.Random random)
logger - The Logger to log to.logMe - A string to log with the result.list - The list.random - A random number source.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||