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