@Immutable @Singleton public final class DiscreteInterpolator extends java.lang.Object implements Interpolator
Because this class has no state, it is implemented as a singleton that is
referenced using the getInstance()
static method. The singleton
instance is thread-safe.
Modifier and Type | Method and Description |
---|---|
static DiscreteInterpolator |
getInstance()
Gets the single
DiscreteInterpolator object. |
double |
interpolate(double 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.
|
java.lang.String |
toString() |
public static DiscreteInterpolator getInstance()
DiscreteInterpolator
object.DiscreteInterpolator
object.@RegionEffects(value="reads Instance") public double interpolate(double 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)0
, but if fraction == 1
, returns 1
.public java.lang.String toString()
toString
in class java.lang.Object