public class CachedDynamicFloatProperty extends DynamicFloatProperty
DynamicFloatProperty 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 float |
primitiveValue |
defaultValue, prop| Constructor and Description |
|---|
CachedDynamicFloatProperty(java.lang.String propName,
float defaultValue) |
| Modifier and Type | Method and Description |
|---|---|
protected float |
chooseValue()
Get the current value from the underlying DynamicProperty
|
float |
get()
Get the current cached value.
|
java.lang.Float |
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 CachedDynamicFloatProperty(java.lang.String propName,
float defaultValue)
protected void propertyChanged()
PropertyWrapperpropertyChanged in class PropertyWrapper<java.lang.Float>protected float chooseValue()
public float get()
get in class DynamicFloatPropertypublic java.lang.Float getValue()
PropertyWrappergetValue in interface Property<java.lang.Float>getValue in class DynamicFloatProperty