1 package aurelienribon.tweenengine; 2 3 /** 4 * Base class for every easing equation. You can create your own equations 5 * and directly use them in the Tween engine by inheriting from this class. 6 * 7 * @see Tween 8 * @author Aurelien Ribon | http://www.aurelienribon.com/ 9 */ 10 public abstract class TweenEquation { 11 12 /** 13 * Computes the next value of the interpolation. 14 * 15 * @param t The current time, between 0 and 1. 16 * @return The current value. 17 */ compute(float t)18 public abstract float compute(float t); 19 20 /** 21 * Returns true if the given string is the name of this equation (the name 22 * is returned in the toString() method, don't forget to override it). 23 * This method is usually used to save/load a tween to/from a text file. 24 */ isValueOf(String str)25 public boolean isValueOf(String str) { 26 return str.equals(toString()); 27 } 28 } 29