|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.upenn.crimson.CrimsonUtils
public class CrimsonUtils
CrimsonUtils. Miscellaneous functions.
Field Summary | |
---|---|
private static java.lang.String |
DATABASE
String containing database name (SID). |
private static java.lang.String |
DB_TYPE
String containing type of database ("oracle" or "mysql"). |
static int |
ERROR
|
static int |
FEEDBACK
|
static javax.swing.JTextArea |
guiMessages
If not null, all error and warning messages will be sent here. |
private static int |
PORT
String containing port connection information (default = 1521). |
static java.util.Random |
random
Global random object. |
private static java.lang.String |
SERVER
String containing server connection information. |
private static java.lang.String |
TMP_DIR
String containing the location of the temporary dataloader files. |
private static java.lang.String |
USERNAME
String containing username for database connection. |
private static int |
VERBOSE
Amount of detailed feedback: 2 = lots, 1 = no warnings (default), 0 = no feedback. |
static int |
WARNING
|
Constructor Summary | |
---|---|
CrimsonUtils()
|
Method Summary | |
---|---|
static boolean |
createTmpDir()
This will create the temporary directory, if necessary, returning 'true' if successful. |
static boolean |
deleteTmpFile(java.lang.String filename)
This will delete the specified file, if it exists in TMP_DIR. |
static java.lang.String |
getClassName(java.lang.Object o)
Get the class name without any package info. |
static java.lang.String |
getDatabase()
Get the DATABASE flag. |
static java.lang.String |
getDBType()
Get the DB_TYPE flag. |
static int |
getPort()
Get the PORT flag. |
static java.lang.String |
getServer()
Get the SERVER flag. |
static java.lang.String |
getTmpDir()
Get the TMP_DIR. |
static java.lang.String |
getUsername()
Get the USERNAME flag. |
static int |
getVerbose()
Get the VERBOSE flag. |
static boolean |
isEmpty(java.util.Collection collection)
Returns true if 'collection' is empty or null. |
static boolean |
isEmpty(java.lang.String str)
Returns true if 'str' is empty (ignores spaces) or null. |
static void |
printError(java.lang.String msg)
Display the message to either the gui or stderr. |
static void |
printMsg(java.lang.String msg)
Display the message to either the gui or stderr. |
static void |
printMsg(java.lang.String msg,
boolean newline)
Display the message to either the gui or stderr. |
static void |
printMsg(java.lang.String msg,
int type)
Display the message to either the gui or stderr. |
static void |
printMsg(java.lang.String msg,
int type,
boolean newline)
Display the message to either the gui or stderr. |
static void |
printWarning(java.lang.String msg)
Display the message to either the gui or stderr. |
static void |
resetCrimsonDefaults()
RE-set Crimson user defaults. |
static void |
setDatabase(java.lang.String database)
Set the DATABASE flag. |
static void |
setDBType(java.lang.String dbType)
Set the DB_TYPE flag. |
static void |
setPort(int port)
Set the PORT flag. |
static void |
setRandomSeed(long seed)
The seed is initially set to the system time. |
static void |
setServer(java.lang.String server)
Set the SERVER flag. |
static void |
setTmpDir(java.lang.String tmpDir)
Set the TMP_DIR variable. |
static java.lang.String |
setToList(java.util.HashSet set)
This will return the elements of a HashSet as a ':' delimited string. |
static void |
setUsername(java.lang.String username)
Set the USERNAME flag. |
static void |
setVerbose(int verbose)
Set the VERBOSE flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WARNING
public static final int ERROR
public static final int FEEDBACK
private static int VERBOSE
private static java.lang.String TMP_DIR
private static java.lang.String USERNAME
private static java.lang.String SERVER
private static int PORT
private static java.lang.String DB_TYPE
private static java.lang.String DATABASE
public static java.util.Random random
public static javax.swing.JTextArea guiMessages
Constructor Detail |
---|
public CrimsonUtils()
Method Detail |
---|
public static void setVerbose(int verbose)
public static int getVerbose()
public static void setTmpDir(java.lang.String tmpDir)
public static java.lang.String getTmpDir()
public static void setUsername(java.lang.String username)
public static java.lang.String getUsername()
public static void setServer(java.lang.String server)
public static java.lang.String getServer()
public static void setPort(int port)
public static int getPort()
public static void setDBType(java.lang.String dbType)
public static java.lang.String getDBType()
public static void setDatabase(java.lang.String database)
public static java.lang.String getDatabase()
public static void setRandomSeed(long seed)
public static boolean isEmpty(java.lang.String str)
public static boolean isEmpty(java.util.Collection collection)
public static void resetCrimsonDefaults()
public static boolean createTmpDir()
public static boolean deleteTmpFile(java.lang.String filename)
public static java.lang.String setToList(java.util.HashSet set)
public static java.lang.String getClassName(java.lang.Object o)
public static void printWarning(java.lang.String msg)
public static void printError(java.lang.String msg)
public static void printMsg(java.lang.String msg)
public static void printMsg(java.lang.String msg, int type)
public static void printMsg(java.lang.String msg, boolean newline)
public static void printMsg(java.lang.String msg, int type, boolean newline)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |