Class LinearInOut

  • All Implemented Interfaces:
    IMovement

    public class LinearInOut
    extends AbstractMovement
    Implementation of a linear movement. The object will move at a constant speed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) double increment  
    • Constructor Summary

      Constructors 
      Constructor Description
      LinearInOut()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getValue​(double step)
      Get value at step 'step'
      void init​(double min, double max, int steps)
      Set up the movement.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • increment

        double increment
    • Constructor Detail

      • LinearInOut

        public LinearInOut()
    • Method Detail

      • init

        public void init​(double min,
                         double max,
                         int steps)
        Description copied from interface: IMovement
        Set up the movement. with init( 0, 1, 50), it will take 50 steps to go from 0 to 1. There is no garanties that getValue will return only values between min and max. The only thing you know is : getValue( 0 ) = 0 and getValue( 50 ) = 1
        Specified by:
        init in interface IMovement
        Overrides:
        init in class AbstractMovement
        Parameters:
        min - - min (start) value
        max - - max( end ) value
        steps - - number of steps