The other answers give you linear interpolations — these don’t really work for complex, nonlinear data. You want a spline fit, (spline interpolation) I believe.
Spline fits describe regions of the data using a set of control points from the data, then apply a polynomial interpolation between control points. More control points gives you a more accurate fit, less a more general fit. Splines are much more accurate than linear fits, faster to use than a general regression fit, better than a high-order polynomial because it won’t do crazy things between control points.
I can’t remember names off the top of my head, but there are some excellent fitting libraries in Java — I suggest you look for one rather than writing your own function.
**EDIT: Libraries that might be useful: **
- JMSL
- JSpline+
- Curfitting library (hope you can read German)
** Theory/code that may be useful: **