|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--Support.Support
Contains miscellaneous static support functions shared by the rest of the system.
| Field Summary | |
static boolean |
ENABLE_LOGGING
|
private static boolean |
PRINT_WARNING_STACK_TRACE
|
static java.util.Random |
randomizer
|
static java.lang.String |
WINDOWS_NEWLINE
|
| Constructor Summary | |
Support()
|
|
| Method Summary | |
static java.lang.String |
chop(java.lang.String string)
Returns a string with its trailing character removed. |
static boolean |
compareReal(double real1,
double real2,
double tolerance)
Returns whether two real numbers are equal within a tolerance. |
static java.lang.String |
formatReal(double value)
Returns a float value formatted as #.##. |
static java.lang.String |
formatReal(float value)
Returns a float value formatted as #.##. |
static java.util.ArrayList |
getFlattenedList(java.util.ArrayList array_list)
Returns a one-dimensional array list from a multidimensional array list (i.e., one containing other array lists). |
static java.util.ArrayList |
getUniqueArrayList(java.util.ArrayList array_list)
Returns an array list with any duplicate elements removed. |
static void |
setRandomSeed(long seed)
Initializes the centralized random-number generator used by the entire system. |
static java.lang.String |
toPrettyString(java.lang.String string)
Returns a string from any well-formed toString() indented according to the braces. |
static java.lang.String |
toSplitString(java.util.ArrayList list)
Returns a newline-delimited string composed of the elements of an array list. |
static java.lang.String |
toSplitString(java.util.ArrayList list,
boolean suppress_newlines)
Returns an optionally newline-delimited string composed of the elements of an array list. |
static java.lang.String |
toSplitString(java.util.Hashtable hash_table)
Returns a newline-delimited string composed of the elements of an hash table. |
static java.lang.String |
toSplitString(java.util.Hashtable list,
boolean suppress_newlines)
Returns an optionally newline-delimited string composed of the elements of a hash table. |
static java.lang.String[] |
toStringArray(java.util.ArrayList array_list)
Returns as a string array the elements of an array list. |
static void |
writeLogEntry(java.lang.String message)
Writes a formatted log entry to stdout. |
static void |
writeWarning(java.lang.String source,
java.lang.String warning)
Writes a warning to stderr with its source and optionally a stack trace. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final boolean ENABLE_LOGGING
public static final java.lang.String WINDOWS_NEWLINE
private static final boolean PRINT_WARNING_STACK_TRACE
public static java.util.Random randomizer
| Constructor Detail |
public Support()
| Method Detail |
public static java.lang.String chop(java.lang.String string)
string - - the string
public static boolean compareReal(double real1,
double real2,
double tolerance)
real1 - - the first real numberreal2 - - the second real numbertolerance - - the tolerance
public static java.lang.String formatReal(float value)
value - - the value
public static java.lang.String formatReal(double value)
value - - the value
public static java.util.ArrayList getFlattenedList(java.util.ArrayList array_list)
array_list - - the array list
public static java.util.ArrayList getUniqueArrayList(java.util.ArrayList array_list)
array_list - - the array list with duplicated elements
public static void setRandomSeed(long seed)
seed - - the seed; pass System.currentTimeMillis() for nondeterministic runspublic static java.lang.String toPrettyString(java.lang.String string)
Side Effect: writes a warning to stderr if the open and close braces do not match.
string - - the stringwriteWarning(java.lang.String, java.lang.String)public static java.lang.String toSplitString(java.util.ArrayList list)
list - - the list
public static java.lang.String toSplitString(java.util.ArrayList list,
boolean suppress_newlines)
list - - the listsuppress_newlines - - whether newline delimiters are disabled
public static java.lang.String toSplitString(java.util.Hashtable hash_table)
hash_table - - the hash table
public static java.lang.String toSplitString(java.util.Hashtable list,
boolean suppress_newlines)
list - - the hash tablesuppress_newlines - - whether newline delimiters are disabled
public static java.lang.String[] toStringArray(java.util.ArrayList array_list)
array_list - - the array list
public static void writeLogEntry(java.lang.String message)
public static void writeWarning(java.lang.String source,
java.lang.String warning)
source - - the source of the warning in the form class_name.method_namewarning - - the warning message
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||