com.miginfocom.ashape.animation
Interface Function

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
ExponentFunction, LinearFunction

public interface Function
extends java.io.Serializable

Interface to denote a function with one argument and one result of some kind.


Method Summary
 Function cloneFunction()
          Returns a cloned instance that can be used freely.
 double f(double v)
          An unspecified function.
 boolean isSolvable()
          Returns if the function is solveable.
 double[] solve(double res, java.lang.Double start, java.lang.Double end)
          The solved values of the function.
 

Method Detail

f

double f(double v)
An unspecified function.

Parameters:
v - A value
Returns:
The value transformed by the funktion. I.e. the result.

solve

double[] solve(double res,
               java.lang.Double start,
               java.lang.Double end)
The solved values of the function. Note that some functions (equations) may result in infinite number of results, for instance trying to solve sin(v) for a result of 0.5 produces overflow if not bounded by a start and end.
Note that for every value returned f(x) must return res.

Parameters:
res - The result
start - If != null denotes the lower boundary for the solved values
end - If != null denotes the higher boundary for the solved values
Returns:
All values that would make a result res using the function f. If the function isn't solvable between start and end for the value res an empty array is returned. If it is not solvable at all, meaning that there exist no reversed values, null should be returned.

isSolvable

boolean isSolvable()
Returns if the function is solveable. If it is solve(double, Double, Double) should never return null.

Returns:
If the function is solveable.

cloneFunction

Function cloneFunction()
Returns a cloned instance that can be used freely. Might be same instance if it is static.

Returns:
A cloned instance that can be used freely.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.