Package ej.motion

Class Motion


  • public class Motion
    extends java.lang.Object
    Represents a motion.
    • Constructor Summary

      Constructors 
      Constructor Description
      Motion​(Function function, int startValue, int stopValue, long duration)
      Creates a motion.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getDuration()
      Gets the duration of this motion.
      Function getFunction()
      Gets the function of this motion.
      int getStartValue()
      Gets the start value of this motion.
      int getStopValue()
      Gets the stop value of this motion.
      int getValue​(long elapsedTime)
      Returns the value of this motion for a specific elapsed time.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.