|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Interpolator
An interpolated value calculator.
This object holds a list of two dimensional points, (xi, yi). Its main job is to calculate a value, f(x), for any x between xi and xi+1, inclusive. This object ensures that its list is ordered such that xi < xi+1, no matter the order in which a client might send it points on which to operate. Interpolators are not permitted to hold more than one point for a given x value.
Version Info:
$Revision: 568 $ |
$Date: 2007-04-27 16:53:09 -0600 (Fri, 27 Apr 2007) $ |
$Author: dharland $ |
Method Summary | |
---|---|
Point2D |
addPoint(Point2D newPoint)
Adds a copy of newPoint to this interpolator. |
void |
clear()
Clears all points from this interpolator. |
NumberInterval |
getDomain()
Returns an interval whose endpoints are the smallest and largest independent ("x") values of the points held by this interpolator. |
List<Point2D> |
getPoints()
Returns a list containing a copy of each point held by this interpolator. |
double |
getValueFor(double x)
Returns a value, f(x), for the given value. |
Point2D |
removePoint(double xValue)
Removes from this interpolator the point, if any, with an independent variable equal to xValue . |
void |
setPoints(List<? extends Point2D> points)
Adds a copy of each of the points in the list to this interpolator. |
int |
size()
Returns the number of points held by this interpolator. |
Method Detail |
---|
double getValueFor(double x)
If the value x
is outside the domain
of this
interpolator, and IllegalArgumentException
is thrown.
x
- the independent variable for which a dependent variable,
f(x) is sought.
void setPoints(List<? extends Point2D> points)
If any of the new points holds an x-value equal to that of a point already held by this interpolator, the already-held point is first removed, and then the new point is added.
points
- a list of new points to be added to this interpolator.Point2D addPoint(Point2D newPoint)
newPoint
to this interpolator.
If this interpolator already contains a point with the same x-value as
newPoint
, that point is first removed and is also the value
returned.
newPoint
- a point to be added to this interpolator.
newPoint
, or null if this interpolator held
no such point.Point2D removePoint(double xValue)
xValue
.
xValue
- the independent variable of the point to be removed.
xValue
. If this
interpolator holds no such point, null is returned.void clear()
int size()
List<Point2D> getPoints()
NumberInterval getDomain()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |