org.genepattern.util
Class GPpropertiesManager

java.lang.Object
  extended byorg.genepattern.util.GPpropertiesManager

public class GPpropertiesManager
extends java.lang.Object

Handles GenePattern properties such as loading, saving, interpreting, etc.


Field Summary
static java.io.File GP_HOME
          the GenePattern home dir (~/gp/)
 
Method Summary
static boolean getBooleanProperty(java.lang.String key)
          returns a true if the property is set to "true" (case insensitive) false if the property is null, "" (empty String), or "false"
static boolean getBooleanProperty(java.lang.String key, boolean default_value)
          returns a true if the property is set to "true" (case insensitive) false if the property is "false" if the Property is not defined ("", the empty String; or null) returns the default_value
static float getFloatProperty(java.lang.String key)
          returns the float value of the property if the Property is not defined ("", the empty String; or null) returns zero 0.0
static float getFloatProperty(java.lang.String key, float default_value)
          returns the float value of the property if the Property is not defined ("", the empty String; or null) returns the default_value
static int getIntProperty(java.lang.String key)
          returns the int value of the property if the Property is not defined ("", the empty String; or null) returns integer zero
static int getIntProperty(java.lang.String key, int default_value)
          returns the int value of the property if the Property is not defined ("", the empty String; or null) returns the default_value
static java.lang.String getProperty(java.lang.String key)
          gets the property if it exists otherwise sets the property to null
static java.lang.String getProperty(java.lang.String key, java.lang.String defaults)
          gets the property if it exists otherwise sets the property to the specified default value and returns the default value
static void saveGenePatternProperties()
          saves the GenePattern Properties
static void setProperty(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GP_HOME

public static final java.io.File GP_HOME
the GenePattern home dir (~/gp/)

Method Detail

getProperty

public static final java.lang.String getProperty(java.lang.String key)
gets the property if it exists otherwise sets the property to null


getProperty

public static final java.lang.String getProperty(java.lang.String key,
                                                 java.lang.String defaults)
gets the property if it exists otherwise sets the property to the specified default value and returns the default value


getBooleanProperty

public static final boolean getBooleanProperty(java.lang.String key)
                                        throws java.text.ParseException
returns a true if the property is set to "true" (case insensitive) false if the property is null, "" (empty String), or "false"

Throws:
if - the value is not "true", "false", null, or empty string
java.text.ParseException

getBooleanProperty

public static final boolean getBooleanProperty(java.lang.String key,
                                               boolean default_value)
                                        throws java.text.ParseException
returns a true if the property is set to "true" (case insensitive) false if the property is "false" if the Property is not defined ("", the empty String; or null) returns the default_value

Throws:
if - the value is not "true", "false", null, or empty string
java.text.ParseException

getIntProperty

public static final int getIntProperty(java.lang.String key)
                                throws java.lang.NumberFormatException
returns the int value of the property if the Property is not defined ("", the empty String; or null) returns integer zero

Throws:
if - the value is not parsable as an int
java.lang.NumberFormatException

getIntProperty

public static final int getIntProperty(java.lang.String key,
                                       int default_value)
                                throws java.lang.NumberFormatException
returns the int value of the property if the Property is not defined ("", the empty String; or null) returns the default_value

Throws:
if - the value is not parsable as an int
java.lang.NumberFormatException

getFloatProperty

public static final float getFloatProperty(java.lang.String key)
                                    throws java.lang.NumberFormatException
returns the float value of the property if the Property is not defined ("", the empty String; or null) returns zero 0.0

Throws:
if - the value is not parsable as a float
java.lang.NumberFormatException

getFloatProperty

public static final float getFloatProperty(java.lang.String key,
                                           float default_value)
                                    throws java.lang.NumberFormatException
returns the float value of the property if the Property is not defined ("", the empty String; or null) returns the default_value

Throws:
if - the value is not parsable as a float
java.lang.NumberFormatException

setProperty

public static final void setProperty(java.lang.String key,
                                     java.lang.String value)

saveGenePatternProperties

public static final void saveGenePatternProperties()
                                            throws java.io.IOException
saves the GenePattern Properties

Throws:
java.io.IOException


Hosted by docs.bugaco.com