You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



All Packages  This Package  Class Hierarchy  Class Search  Index

Interface calypso.util.Preferences

This is an interface to get things from the Preferences database.

See Also: PreferencesFactory


public interface  Preferences
{
          // Methods 12
     public abstract void addDefaults(Properties);
     public abstract Properties getAsProperties();
     public abstract boolean getBoolean(String);
     public abstract boolean getBoolean(String, boolean);
     public abstract File getFile(String, File);
     public abstract int getInt(String);
     public abstract int getInt(String, int);
     public abstract String getString(String);
     public abstract String getString(String, String);
     public abstract void putBoolean(String, boolean);
     public abstract void putInt(String, int);
     public abstract void putString(String, String);
}



Methods


addDefaults

   public abstract void addDefaults(Properties defs) 

Add a table of default values. You must add defaults for each preference you use.



getString

   public abstract String getString(String prefname, 
                                    String defaultValue) 

Given a name of a preference, return its value as a String. If it's not defined, return the given default.



getString

   public abstract String getString(String prefname) 

Given a name of a preference, return its value as a String.



getInt

   public abstract int getInt(String prefname, 
                              int defaultValue) 

Given a name of a preference, return its value as an int. If it's not defined, return the given default.



getInt

   public abstract int getInt(String prefname) 

Given a name of a preference, return its value as an int.



getBoolean

   public abstract boolean getBoolean(String prefname, 
                                      boolean defaultValue) 

Given a name of a preference, return its value as a boolean. If it's not defined, return the given default.



getBoolean

   public abstract boolean getBoolean(String prefname) 

Given a name of a preference, return its value as a boolean.



getFile

   public abstract File getFile(String prefname, 
                                File defaultValue) 

Given a name of a preference, return its value as an File. If it's not defined, return the given default.



putString

   public abstract void putString(String prefname, 
                                  String value) 

Assign a String value to the given preference.



putInt

   public abstract void putInt(String prefname, 
                               int value) 

Assign an int value to the given preference.



putBoolean

   public abstract void putBoolean(String prefname, 
                                   boolean value) 

Assign a boolean value to the given preference.



getAsProperties

   public abstract Properties getAsProperties() 

Return the preferences as a Properties object



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.4