Package ej.motion

Class Motion


  • public class Motion
    extends Object
    Represents a motion.
    • Constructor Detail

      • Motion

        public Motion​(Function function,
                      int startValue,
                      int stopValue,
                      long duration)
        Creates a motion.
        Parameters:
        function - the function of the motion.
        startValue - the start value of the motion.
        stopValue - the stop value of the motion.
        duration - the duration of the motion.
    • Method Detail

      • getFunction

        public Function getFunction()
        Gets the function of this motion.
        Returns:
        the function of this motion.
      • getStartValue

        public int getStartValue()
        Gets the start value of this motion.
        Returns:
        the start value of this motion.
      • getStopValue

        public int getStopValue()
        Gets the stop value of this motion.
        Returns:
        the stop value of this motion.
      • getDuration

        public long getDuration()
        Gets the duration of this motion.
        Returns:
        the duration of this motion.
      • getValue

        public int getValue​(long elapsedTime)
        Returns the value of this motion for a specific elapsed time.
        Parameters:
        elapsedTime - the elapsed time.
        Returns:
        the value for the given elapsed time.