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 t = 0 produces
the start value, t = 1 produces the end value, and 0 < t < 1 produces
(1 - t) * start + t * end. 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 is not required to reject interpolation factors less than 0 or larger than 1, but this specification gives no meaning to values returned outside of this range. For example, an implementation might clamp the interpolation factor to [0..1], or it might continue the linear interpolation outside of this range.
| |