1 package aurelienribon.tweenengine.primitives; 2 3 import aurelienribon.tweenengine.TweenAccessor; 4 5 /** 6 * @author Aurelien Ribon | http://www.aurelienribon.com/ 7 */ 8 public class MutableFloat extends Number implements TweenAccessor<MutableFloat> { 9 private float value; 10 MutableFloat(float value)11 public MutableFloat(float value) { 12 this.value = value; 13 } 14 setValue(float value)15 public void setValue(float value) { 16 this.value = value; 17 } 18 intValue()19 @Override public int intValue() {return (int) value;} longValue()20 @Override public long longValue() {return (long) value;} floatValue()21 @Override public float floatValue() {return (float) value;} doubleValue()22 @Override public double doubleValue() {return (double) value;} 23 24 @Override getValues(MutableFloat target, int tweenType, float[] returnValues)25 public int getValues(MutableFloat target, int tweenType, float[] returnValues) { 26 returnValues[0] = target.value; 27 return 1; 28 } 29 30 @Override setValues(MutableFloat target, int tweenType, float[] newValues)31 public void setValues(MutableFloat target, int tweenType, float[] newValues) { 32 target.value = newValues[0]; 33 } 34 } 35