interpolate(Object, double)
method, which returns an intermediate value between the value of this Interpolatable
and the specified target value.
Component values can be interpolated in different ways, depending on the semantics of the component type:
| default | Component types that implement Interpolatable are interpolated by calling the
interpolate(Object, double) method. |
| linear | Two components are combined by linear interpolation such that the intermediate value is
produced by computing (1 - t) * start + t * end. Note that this formula produces
values less than start for t < 0 and values greater than end for
t > 1. This interpolation type is usually applicable for numeric components. |
| discrete | If two components cannot be meaningfully combined, the intermediate component value
is equal to the start value for t < 0.5 and equal to the end value for
t >= 0.5. |
| pairwise | Two lists are combined by pairwise interpolation. Paired list elements are interpolated with rules as described in this table (substituting "component" for "element"). If the start list has fewer elements than the target list, the missing elements are copied from the target list. If the start list has more elements than the target list, the excess elements are discarded. |
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: the intermediate valuethe target value endValue, double the interpolation factor t)Returns an intermediate value between the value of this |
| interpolate | back to summary |
|---|---|
| public T interpolate(T endValue, double t) Returns an intermediate value between the value of this The returned value might not be a new instance; the implementation might also return one of the two existing instances if the intermediate value would be equal to one of the existing values. However, this is an optimization and applications should not assume any particular identity of the returned value. Implementation Specification An implementation must accept any interpolation factor, but it can return a clamped intermediate value that falls within its value range.
| |