|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectecologylab.generic.Generic
public class Generic
A set of generic convenience methods for doing things like getting
typed parameters from the envionment, getting other stuff from
the environment, building HashMaps from arrays, manipulating threads,
... While some of these functionalities constitute a nice set of static
covers for facilities provided by Environment,
this class can be viewed as a kitchen sink of useful static methods.
| Field Summary | |
|---|---|
static java.lang.String |
SEP
|
| Constructor Summary | |
|---|---|
Generic()
|
|
| Method Summary | |
|---|---|
static void |
beep()
|
static boolean |
booleanFromString(java.lang.String value)
Convert a String to a boolean. |
static java.lang.Object |
findEqual(java.util.List list,
java.lang.Object object)
Find the first object equal to the one passed in as the second argument, within the List that is the first argument. |
static java.lang.ThreadGroup |
findThreadGroup(int priority)
|
static java.lang.ThreadGroup |
findThreadGroup(java.lang.ThreadGroup threadGroup,
int priority)
|
static java.lang.ThreadGroup |
findThreadGroup(java.lang.Thread thread,
int priority)
|
static int |
getMaxMemory()
Returns the environment's current max memory settings (based on command-line parameters in the java control panel) |
static void |
main(java.lang.String[] s)
|
static java.lang.String |
narrowFloat(float f)
|
static float |
parseFloat(java.lang.String floatString)
Turn a string into a float. |
static int |
parseInt(java.lang.String input,
int defaultVal)
|
static void |
raiseMaxPriority(int priority)
|
static void |
raiseMaxPriority(java.lang.ThreadGroup threadGroup,
int priority)
|
static void |
raiseMaxPriority(java.lang.Thread thread,
int priority)
|
static void |
raisePriority(int priority)
Raise the priority of the current thread to the priority level, if the current priority level is less than it. |
static java.lang.String |
round(float f,
int powerOfTen)
|
static void |
setPriority(int priority)
Set the priority of the current thread. |
static void |
setPriority(java.lang.Thread t,
int priority)
Set the priority of the current thread. |
static void |
showDialog(java.lang.String msg)
|
static void |
sleep(int time)
Sleep easily. |
static void |
sleep(int time,
boolean reportExceptions)
Sleep easily. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SEP
| Constructor Detail |
|---|
public Generic()
| Method Detail |
|---|
public static boolean booleanFromString(java.lang.String value)
value -
public static float parseFloat(java.lang.String floatString)
public static final void sleep(int time)
InterruptedExceptions when they happen,
if the param is true.
public static final void sleep(int time,
boolean reportExceptions)
InterruptedExceptions when they happen,
if the param is true.
public static final void setPriority(int priority)
public static final void setPriority(java.lang.Thread t,
int priority)
public static java.lang.String round(float f,
int powerOfTen)
public static void raisePriority(int priority)
priority - public static void raiseMaxPriority(int priority)
public static void raiseMaxPriority(java.lang.Thread thread,
int priority)
public static void raiseMaxPriority(java.lang.ThreadGroup threadGroup,
int priority)
public static java.lang.ThreadGroup findThreadGroup(int priority)
public static java.lang.ThreadGroup findThreadGroup(java.lang.Thread thread,
int priority)
public static java.lang.ThreadGroup findThreadGroup(java.lang.ThreadGroup threadGroup,
int priority)
public static final int parseInt(java.lang.String input,
int defaultVal)
input.
Silently defaults to defaultVal, input is
not in good form.public static void main(java.lang.String[] s)
public static void beep()
public static java.lang.Object findEqual(java.util.List list,
java.lang.Object object)
list - The list to search.object - The object to look for. Must not be null.
public static int getMaxMemory()
public static void showDialog(java.lang.String msg)
public static java.lang.String narrowFloat(float f)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||