ca.sqlpower.wabit.swingui.chart.effect.interp
Interface Interpolator

All Known Implementing Classes:
BallDropInterpolator, LinearInterpolator, PolynomialInterpolator

@Immutable
public interface Interpolator

Defines the contract for a class that produces interpolated values using arbitrary interpolation rules.

Instances of Interpolator must be immutable.


Method Summary
 double value(double start, double end, double pct)
          Calculates and returns an interpolated value.
 

Method Detail

value

double value(double start,
             double end,
             double pct)
Calculates and returns an interpolated value.

Parameters:
start - The value that will be returned when pct == 0.0
end - The value that will be returned when pct == 1.0
pct - A value between 0.0 and 1.0 that indicates how far "along the way" the interpolated value should be. Values outside the range 0.0..1.0 produce undefined results.
Returns:
An interpolated value for the given parameters. When pct=0.0, the value of start is returned. When pct=1.0, the value of end is returned. For values of pct between 0.0 and 1.0, the returned value is calculated according to the particular Interpolator in use. In general, it is not guaranteed to lie between start and end (some interpolators may "overshoot" either endpoint then come back to it).


Copyright © 2009. All Rights Reserved.