edu.upenn.gloDB
Class GloDBUtils

java.lang.Object
  extended by edu.upenn.gloDB.GloDBUtils

public class GloDBUtils
extends java.lang.Object

GloDBUtils. Miscellaneous functions.

Version:
$Id: GloDBUtils.java,v 1.1.2.9 2007/03/01 21:17:32 fisher Exp $

Field Summary
static int ERROR
           
static int FEATURE
           
static int FEEDBACK
           
static javax.swing.JTextArea guiMessages
          If not null, all error and warning messages will be sent here.
private static boolean IGNORE_ATTRIBUTES
          This flag is used in FeatureUtils.compareFeatures() to compare two Features.
static int SEQUENCE
           
static int TRACK
           
private static int VERBOSE
          Amount of detailed feedback: 2 = lots, 1 = no warnings, 0 = no feedback.
static int WARNING
           
 
Constructor Summary
GloDBUtils()
           
 
Method Summary
static byte[] compressString(java.lang.String val)
           
static java.lang.String convertConstant(int val)
          Convert from the integer constant value to a string equivalent.
static java.lang.String getClassName(java.lang.Object o)
          Get the class name without any package info.
static int getVerbose()
          Get the VERBOSE flag.
static boolean ignoreAttributes()
          Get the IGNORE_ATTRIBUTES flag.
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 error 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 warning message to either the gui or stderr.
static void resetGloDBDefaults()
          RE-set GloDB user defaults.
static void setIgnoreAttributes(boolean ignoreAttributes)
          Set the IGNORE_ATTRIBUTES flag.
static void setVerbose(int verbose)
          Set the VERBOSE flag.
static java.lang.String uncompressString(byte[] compressedData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACK

public static final int TRACK
See Also:
Constant Field Values

SEQUENCE

public static final int SEQUENCE
See Also:
Constant Field Values

FEATURE

public static final int FEATURE
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

FEEDBACK

public static final int FEEDBACK
See Also:
Constant Field Values

VERBOSE

private static int VERBOSE
Amount of detailed feedback: 2 = lots, 1 = no warnings, 0 = no feedback.


IGNORE_ATTRIBUTES

private static boolean IGNORE_ATTRIBUTES
This flag is used in FeatureUtils.compareFeatures() to compare two Features. If 'true', then only the Feature source and start/stop positions will be used. If 'false', then the hashCode of the attributes HashMap will also be used. This allows for Features identically placed but with different attributes to coexist in a Track. Thus if two Features exist at the exact same location on a sequence, this flag will determine whether the attributes field will be used when deciding if these are in fact the same Feature.


guiMessages

public static javax.swing.JTextArea guiMessages
If not null, all error and warning messages will be sent here. This messages panel can be disabled by setting the value to null. When disabled, all messages printed will be sent to stderr, which will effectively display them in the console.

Constructor Detail

GloDBUtils

public GloDBUtils()
Method Detail

setVerbose

public static void setVerbose(int verbose)
Set the VERBOSE flag.


getVerbose

public static int getVerbose()
Get the VERBOSE flag.


setIgnoreAttributes

public static void setIgnoreAttributes(boolean ignoreAttributes)
Set the IGNORE_ATTRIBUTES flag.


ignoreAttributes

public static boolean ignoreAttributes()
Get the IGNORE_ATTRIBUTES flag.


isEmpty

public static boolean isEmpty(java.lang.String str)
Returns true if 'str' is empty (ignores spaces) or null.


resetGloDBDefaults

public static void resetGloDBDefaults()
RE-set GloDB user defaults.


convertConstant

public static java.lang.String convertConstant(int val)
Convert from the integer constant value to a string equivalent.


getClassName

public static java.lang.String getClassName(java.lang.Object o)
Get the class name without any package info.


compressString

public static byte[] compressString(java.lang.String val)

uncompressString

public static java.lang.String uncompressString(byte[] compressedData)

printMsg

public static void printMsg(java.lang.String msg)
Display the message to either the gui or stderr.


printMsg

public static void printMsg(java.lang.String msg,
                            int type)
Display the message to either the gui or stderr.


printMsg

public static void printMsg(java.lang.String msg,
                            boolean newline)
Display the message to either the gui or stderr.


printError

public static void printError(java.lang.String msg)
Display the error message to either the gui or stderr.


printWarning

public static void printWarning(java.lang.String msg)
Display the warning message to either the gui or stderr.


printMsg

public static void printMsg(java.lang.String msg,
                            int type,
                            boolean newline)
Display the message to either the gui or stderr. The message type can be set which will add the appropriate label to the message (1 = warning, 2 = error).




Copyright 2012 Stephen Fisher and Junhyong Kim, University of Pennsylvania. All Rights Reserved.