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 MutableInteger extends Number implements TweenAccessor<MutableInteger> { 9 private int value; 10 MutableInteger(int value)11 public MutableInteger(int value) { 12 this.value = value; 13 } 14 setValue(int value)15 public void setValue(int 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(MutableInteger target, int tweenType, float[] returnValues)25 public int getValues(MutableInteger target, int tweenType, float[] returnValues) { 26 returnValues[0] = target.value; 27 return 1; 28 } 29 30 @Override setValues(MutableInteger target, int tweenType, float[] newValues)31 public void setValues(MutableInteger target, int tweenType, float[] newValues) { 32 target.value = (int) newValues[0]; 33 } 34 } 35