org.browsecode.helpers.preferences
Interface Preferences
- All Superinterfaces:
- HasKeyValues, HasKeyValuesModifiable, KeyValuesModifiable
- All Known Implementing Classes:
- PreferencesFromFile, PreferencesSubset
public interface Preferences
- extends HasKeyValuesModifiable
Preferences loads and saves prefs to a file for a particular program (or set of programs).
It also automatically saves the preferences when the system exits. You may call "savePrefs()" if you want to, but you don't have to.
Method Summary |
java.lang.Boolean |
getBooleanObjectPreference(java.lang.String key)
|
boolean |
getBooleanPreference(java.lang.String key)
Returns false if the value isn't in the database, by default. |
boolean |
getBooleanPreference(java.lang.String key,
boolean defaultValue)
Returns false if the value isn't in the database, by default. |
java.util.Vector<java.lang.Boolean> |
getBooleanPreferenceVector(java.lang.String key)
|
java.lang.Integer |
getIntegerPreference(java.lang.String key)
|
int |
getIntPreference(java.lang.String key)
Returns -1 if the value isn't in the database. |
java.lang.String |
getPreference(java.lang.String key)
|
java.lang.String[] |
getPreferenceList(java.lang.String key)
|
Preferences |
getPreferencesSubset(java.lang.String key)
|
Preferences |
getPreferencesSubsetFromVector(java.lang.String key,
int vectorIndex)
|
Preferences |
getPreferencesSubsetFromVectorName(java.lang.String nameInVector)
|
Preferences |
getPreferencesSubsetFromVectorName(java.lang.String key,
java.lang.String vectorName)
|
java.util.Vector<java.lang.String> |
getPreferenceVector(java.lang.String key)
|
java.util.Vector<java.util.Vector<java.lang.String>> |
getPreferenceVectorOfVectors(java.lang.String key)
|
void |
removePreferenceVectorIndex(java.lang.String key,
int indexToDelete)
|
void |
savePrefs()
|
void |
setBooleanObjectPreference(java.lang.String key,
java.lang.Boolean value)
|
void |
setBooleanPreference(java.lang.String key,
boolean value)
|
void |
setBooleanPreferenceVector(java.lang.String key,
java.util.Vector<java.lang.Boolean> v)
|
void |
setIntegerPreference(java.lang.String key,
java.lang.Integer value)
|
void |
setIntPreference(java.lang.String key,
int value)
|
void |
setPreference(java.lang.String key,
java.lang.String value)
|
void |
setPreferenceList(java.lang.String key,
java.lang.String[] values)
|
void |
setPreferenceVector(java.lang.String key,
java.util.Vector<java.lang.String> v)
|
void |
setPreferenceVectorOfVectors(java.lang.String key,
java.util.Vector<java.util.Vector<java.lang.String>> v)
|
savePrefs
void savePrefs()
getPreferenceList
java.lang.String[] getPreferenceList(java.lang.String key)
setPreferenceList
void setPreferenceList(java.lang.String key,
java.lang.String[] values)
getBooleanPreferenceVector
java.util.Vector<java.lang.Boolean> getBooleanPreferenceVector(java.lang.String key)
setBooleanPreferenceVector
void setBooleanPreferenceVector(java.lang.String key,
java.util.Vector<java.lang.Boolean> v)
setPreferenceVectorOfVectors
void setPreferenceVectorOfVectors(java.lang.String key,
java.util.Vector<java.util.Vector<java.lang.String>> v)
getPreferenceVectorOfVectors
java.util.Vector<java.util.Vector<java.lang.String>> getPreferenceVectorOfVectors(java.lang.String key)
setPreferenceVector
void setPreferenceVector(java.lang.String key,
java.util.Vector<java.lang.String> v)
getPreferenceVector
java.util.Vector<java.lang.String> getPreferenceVector(java.lang.String key)
removePreferenceVectorIndex
void removePreferenceVectorIndex(java.lang.String key,
int indexToDelete)
getIntPreference
int getIntPreference(java.lang.String key)
- Returns -1 if the value isn't in the database.
- Parameters:
key
-
- Returns:
getIntegerPreference
java.lang.Integer getIntegerPreference(java.lang.String key)
setIntPreference
void setIntPreference(java.lang.String key,
int value)
setIntegerPreference
void setIntegerPreference(java.lang.String key,
java.lang.Integer value)
getBooleanPreference
boolean getBooleanPreference(java.lang.String key)
- Returns false if the value isn't in the database, by default.
- Parameters:
key
-
- Returns:
getBooleanPreference
boolean getBooleanPreference(java.lang.String key,
boolean defaultValue)
- Returns false if the value isn't in the database, by default.
- Parameters:
key
-
- Returns:
setBooleanPreference
void setBooleanPreference(java.lang.String key,
boolean value)
getBooleanObjectPreference
java.lang.Boolean getBooleanObjectPreference(java.lang.String key)
setBooleanObjectPreference
void setBooleanObjectPreference(java.lang.String key,
java.lang.Boolean value)
getPreference
java.lang.String getPreference(java.lang.String key)
setPreference
void setPreference(java.lang.String key,
java.lang.String value)
getPreferencesSubset
Preferences getPreferencesSubset(java.lang.String key)
getPreferencesSubsetFromVector
Preferences getPreferencesSubsetFromVector(java.lang.String key,
int vectorIndex)
getPreferencesSubsetFromVectorName
Preferences getPreferencesSubsetFromVectorName(java.lang.String nameInVector)
getPreferencesSubsetFromVectorName
Preferences getPreferencesSubsetFromVectorName(java.lang.String key,
java.lang.String vectorName)