Package com.jgoodies.animation
Class AnimationFunctions.RandomAnimationFunction
- java.lang.Object
-
- com.jgoodies.animation.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.
-
-
-
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 interfaceAnimationFunction<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 interfaceAnimationFunction<java.lang.Integer>
- Parameters:
time
- the time used to determine the animation effect- Returns:
- the function value at the given time
-
-