public class CachedDynamicIntProperty extends DynamicIntProperty
DynamicIntProperty that caches the primitive value whenever it is changed.
This can give improved performance due to avoiding the unboxing, at the expense of additional
memory usage.| Modifier and Type | Field and Description |
|---|---|
protected int |
primitiveValue |
defaultValue, prop| Constructor and Description |
|---|
CachedDynamicIntProperty(java.lang.String propName,
int defaultValue) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
chooseValue()
Get the current value from the underlying DynamicProperty
|
int |
get()
Get the current cached value.
|
java.lang.Integer |
getValue()
Get current typed value of the property.
|
protected void |
propertyChanged()
Called when the property value is updated.
|
addCallback, addValidator, getChangedTimestamp, getDefaultValue, getDynamicProperty, getName, propertyChanged, registerSubClassWithNoCallback, removeAllCallbacks, toString, validatepublic CachedDynamicIntProperty(java.lang.String propName,
int defaultValue)
protected void propertyChanged()
PropertyWrapperpropertyChanged in class PropertyWrapper<java.lang.Integer>protected int chooseValue()
public int get()
get in class DynamicIntPropertypublic java.lang.Integer getValue()
PropertyWrappergetValue in interface Property<java.lang.Integer>getValue in class DynamicIntProperty