org.jdesktop.animation.timing.interpolation
public final class DiscreteInterpolator extends Object implements Interpolator
Because there is no variation to this class, it is a singleton and
is referenced by using the getInstance()
static method.
Modifier and Type | Method and Description |
---|---|
static DiscreteInterpolator |
getInstance()
Returns the single DiscreteInterpolator object
|
float |
interpolate(float fraction)
This method always returns 0 for inputs less than 1,
which will force users of this
interpolation to assign a value equal to the value at the beginning
of this timing interval, which is the desired behavior for discrete
animations.
|
public static DiscreteInterpolator getInstance()
public float interpolate(float fraction)
interpolate
in interface Interpolator
fraction
- a value between 0 and 1, representing the elapsed
fraction of a time interval (either an entire animation cycle or an
interval between two KeyTimes, depending on where this Interpolator has
been set)fracton == 0
, returns 1.