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 11 public MutableFloat(float value) { 12 this.value = value; 13 } 14 15 public void setValue(float value) { 16 this.value = value; 17 } 18 19 @Override public int intValue() {return (int) value;} 20 @Override public long longValue() {return (long) value;} 21 @Override public float floatValue() {return (float) value;} 22 @Override public double doubleValue() {return (double) value;} 23 24 @Override 25 public int getValues(MutableFloat target, int tweenType, float[] returnValues) { 26 returnValues[0] = target.value; 27 return 1; 28 } 29 30 @Override 31 public void setValues(MutableFloat target, int tweenType, float[] newValues) { 32 target.value = newValues[0]; 33 } 34 } 35