|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.settings.Setting
Private abstract class for an individual setting. Subclasses of this class provide typing for settings.
Field Summary | |
protected java.util.Properties |
DEFAULT_PROPS
Protected default Properties instance for subclasses. |
protected java.lang.String |
DEFAULT_VALUE
Constant for the default value for this Setting. |
protected java.lang.String |
KEY
The constant key for this property, specified upon construction. |
protected java.util.Properties |
PROPS
Protected Properties instance containing properties for any subclasses. |
Constructor Summary | |
protected |
Setting(java.util.Properties defaultProps,
java.util.Properties props,
java.lang.String key,
java.lang.String defaultValue)
Constructs a new setting with the specified key and default value. |
Method Summary | |
java.lang.String |
getKey()
Get the key for this setting. |
java.lang.String |
getValueAsString()
Returns the value as stored in the properties file. |
boolean |
isDefault()
Determines whether or not the current value is the default value. |
protected abstract void |
loadValue(java.lang.String sValue)
Load value from property string value |
void |
reload()
Reload value from properties object |
void |
revertToDefault()
Revert to the default value. |
Setting |
setAlwaysSave(boolean save)
Sets whether or not this setting should always save, even if it is default. |
protected void |
setValue(java.lang.String value)
Set new property value |
boolean |
shouldAlwaysSave()
Determines whether or not this value should always be saved to disk. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final java.util.Properties DEFAULT_PROPS
protected final java.util.Properties PROPS
protected final java.lang.String KEY
protected final java.lang.String DEFAULT_VALUE
Constructor Detail |
protected Setting(java.util.Properties defaultProps, java.util.Properties props, java.lang.String key, java.lang.String defaultValue)
key
- the key for the settingdefaultValue
- the defaultValue for the setting
IllegalArgumentException
- if the key for this
setting is already contained in the map of default settingsMethod Detail |
public void reload()
public void revertToDefault()
public boolean shouldAlwaysSave()
public Setting setAlwaysSave(boolean save)
public boolean isDefault()
public java.lang.String getKey()
public java.lang.String getValueAsString()
protected void setValue(java.lang.String value)
value
- new property valueprotected abstract void loadValue(java.lang.String sValue)
sValue
- property string value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |