|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.limewire.setting.AbstractSetting
org.limewire.setting.AbstractNumberSetting<T>
public abstract class AbstractNumberSetting<T extends Number & Comparable<T>>
Provides a Number setting value and
ensures any value you set in the future falls within a range. As a subclass
of Setting, the setting has a key. If the value is set outside
the number range, the value is set to the closer value of either the minimum
or maximum range value. For example, if the range is [0,2] and you set the
value to 8, the value is actually set to 2.
Additionally, AbstractNumber defines a method
for subclasses to convert a string to a Comparable.
| Field Summary | |
|---|---|
protected T |
MAX_VALUE
Adds a safeguard against remote making a setting take a value beyond the reasonable max |
protected T |
MIN_VALUE
Adds a safeguard against remote making a setting take a value below the reasonable min |
| Fields inherited from class org.limewire.setting.AbstractSetting |
|---|
DEFAULT_PROPS, DEFAULT_VALUE, KEY, PROPS |
| Constructor Summary | |
|---|---|
protected |
AbstractNumberSetting(Properties defaultProps,
Properties props,
String key,
String defaultValue,
boolean remote,
T min,
T max)
|
| Method Summary | |
|---|---|
protected abstract Comparable<T> |
convertToComparable(String value)
Converts a String to a Comparable of the same type as MAX_VALUE and MIN_VALUE. |
protected String |
normalizeValue(String value)
Normalizes a value to an acceptable value for this setting. |
protected void |
setValueInternal(String value)
Set new property value |
| Methods inherited from class org.limewire.setting.AbstractSetting |
|---|
addSettingListener, fireSettingEvent, fireSettingEvent, getKey, getSettingListeners, getValueAsString, isDefault, isPrivate, loadValue, reload, removeSettingListener, revertToDefault, setAlwaysSave, setPrivate, shouldAlwaysSave, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final T extends Number & Comparable<T> MAX_VALUE
protected final T extends Number & Comparable<T> MIN_VALUE
| Constructor Detail |
|---|
protected AbstractNumberSetting(Properties defaultProps,
Properties props,
String key,
String defaultValue,
boolean remote,
T min,
T max)
| Method Detail |
|---|
protected void setValueInternal(String value)
setValueInternal in class AbstractSettingvalue - new property valueprotected String normalizeValue(String value)
protected abstract Comparable<T> convertToComparable(String value)
|
LimeWire Consolidated API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||