Class AnimationFunctions.RandomAnimationFunction

  • All Implemented Interfaces:
    AnimationFunction<java.lang.Integer>
    Enclosing class:
    AnimationFunctions

    private static final class AnimationFunctions.RandomAnimationFunction
    extends java.lang.Object
    implements AnimationFunction<java.lang.Integer>
    Produces and returns random Integer values.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private float changeProbability  
      private int max  
      private int min  
      private java.util.Random random  
      private java.lang.Integer value  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RandomAnimationFunction​(int min, int max, float changeProbability)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long duration()
      Returns the length of this function's valid time interval.
      java.lang.Integer valueAt​(long time)
      Returns the function value at a given time in the valid time interval.
      • Methods inherited from class java.lang.Object

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

      • changeProbability

        private final float changeProbability
      • max

        private final int max
      • min

        private final int min
      • random

        private final java.util.Random random
      • value

        private java.lang.Integer value
    • Constructor Detail

      • RandomAnimationFunction

        private RandomAnimationFunction​(int min,
                                        int max,
                                        float changeProbability)
    • Method Detail

      • duration

        public long duration()
        Description copied from interface: AnimationFunction
        Returns the length of this function's valid time interval.
        Specified by:
        duration in interface AnimationFunction<java.lang.Integer>
        Returns:
        the length of this function's valid time interval
      • valueAt

        public java.lang.Integer valueAt​(long time)
        Description copied from interface: AnimationFunction
        Returns the function value at a given time in the valid time interval. The value is undefined for times outside this function's time interval. An implementation may throw an exception, if this method called with a time outside the time interval.
        Specified by:
        valueAt in interface AnimationFunction<java.lang.Integer>
        Parameters:
        time - the time used to determine the animation effect
        Returns:
        the function value at the given time