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 floatchangeProbabilityprivate intmaxprivate intminprivate java.util.Randomrandomprivate java.lang.Integervalue
-
Constructor Summary
Constructors Modifier Constructor Description privateRandomAnimationFunction(int min, int max, float changeProbability)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longduration()Returns the length of this function's valid time interval.java.lang.IntegervalueAt(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:AnimationFunctionReturns the length of this function's valid time interval.- Specified by:
durationin 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:AnimationFunctionReturns 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:
valueAtin interfaceAnimationFunction<java.lang.Integer>- Parameters:
time- the time used to determine the animation effect- Returns:
- the function value at the given time
-
-