public abstract class CachedProperty<T> extends AbstractProperty<T> implements Preferences.PreferenceChangedListener
| Modifier and Type | Field and Description |
|---|---|
private String |
defaultValueAsString |
private int |
updateCount |
private T |
value |
defaultValue, key| Modifier | Constructor and Description |
|---|---|
protected |
CachedProperty(String key,
String defaultValueAsString) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
fromString(String s) |
T |
get()
Replies the value of this property.
|
String |
getAsString() |
T |
getDefaultValue()
Replies the default value of this property.
|
String |
getDefaultValueAsString() |
int |
getUpdateCount() |
void |
preferenceChanged(Preferences.PreferenceChangeEvent e) |
void |
put(String value) |
boolean |
put(T value)
Sets this property to the specified value.
|
protected void |
updateValue() |
getKey, isSet, removeprivate final String defaultValueAsString
private int updateCount
protected CachedProperty(String key, String defaultValueAsString)
protected void updateValue()
protected abstract T fromString(String s)
public T get()
AbstractPropertyget in class AbstractProperty<T>public final boolean put(T value)
AbstractPropertyput in class AbstractProperty<T>value - The new value of this propertypublic int getUpdateCount()
public T getDefaultValue()
AbstractPropertygetDefaultValue in class AbstractProperty<T>public String getDefaultValueAsString()
public String getAsString()
public void preferenceChanged(Preferences.PreferenceChangeEvent e)
preferenceChanged in interface Preferences.PreferenceChangedListener