net.sf.borg.common
Class Prefs

java.lang.Object
  extended by net.sf.borg.common.Prefs

public class Prefs
extends Object

class for managing Borg preferences.


Nested Class Summary
static interface Prefs.Listener
          Interface for classes that want to be notified of preference changes
 
Method Summary
static void addListener(Prefs.Listener listener)
          add a listener
static void export(String filename)
          Export preferences to a file
static boolean getBoolPref(PrefName pn)
          Get a boolean preference value
static int getIntPref(PrefName pn)
          Get an integer preference value
static String getPref(PrefName pn)
          Get a string preference value
static void importPrefs(String filename)
          Import preferences from a file
static void notifyListeners()
          Notify listeners of a pref change.
static void putPref(PrefName pn, Object val)
          store a preference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addListener

public static void addListener(Prefs.Listener listener)
add a listener

Parameters:
listener - the listener

notifyListeners

public static void notifyListeners()
Notify listeners of a pref change.


getPref

public static String getPref(PrefName pn)
Get a string preference value

Parameters:
pn - the preference name object
Returns:
the value

getIntPref

public static int getIntPref(PrefName pn)
Get an integer preference value

Parameters:
pn - the preference name object
Returns:
the int value

getBoolPref

public static boolean getBoolPref(PrefName pn)
Get a boolean preference value

Parameters:
pn - the preference name object
Returns:
the boolen value

putPref

public static void putPref(PrefName pn,
                           Object val)
store a preference

Parameters:
pn - the preference name object
val - the value

importPrefs

public static void importPrefs(String filename)
Import preferences from a file

Parameters:
filename - the filename

export

public static void export(String filename)
Export preferences to a file

Parameters:
filename - the filename


Generated September 24 2010 by mbb using Apache Ant version 1.7.1 compiled on June 27 2008 and Java version 1.6.0_20 from Sun Microsystems Inc. on Linux i386 2.6.24-28-generic