com.miginfocom.ashape.animation
Class LinearFunction

java.lang.Object
  extended by com.miginfocom.ashape.animation.LinearFunction
All Implemented Interfaces:
Function, java.io.Serializable

public class LinearFunction
extends java.lang.Object
implements Function

A function that is very simple. It's just x = y.

See Also:
Serialized Form

Constructor Summary
LinearFunction()
          Constructor.
 
Method Summary
 Function cloneFunction()
          Returns a cloned instance that can be used freely.
 boolean equals(java.lang.Object o)
           
 double f(double v)
          Linear implementation.
 boolean isSolvable()
          Returns if the function is solveable.
 double[] solve(double res, java.lang.Double lo, java.lang.Double hi)
          Just returns res unchanged if within bounds.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearFunction

public LinearFunction()
Constructor.

Method Detail

f

public final double f(double v)
Linear implementation.

Specified by:
f in interface Function
Parameters:
v - The value
Returns:
v unchanged.

solve

public final double[] solve(double res,
                            java.lang.Double lo,
                            java.lang.Double hi)
Just returns res unchanged if within bounds.

Specified by:
solve in interface Function
Parameters:
res - Will be returned
lo - will not return a value lower that this. null if no other values exist.
hi - will not return a value higher that this. null if no other values exist.
Returns:
An array containing res.

isSolvable

public boolean isSolvable()
Description copied from interface: Function
Returns if the function is solveable. If it is Function.solve(double, Double, Double) should never return null.

Specified by:
isSolvable in interface Function
Returns:
If the function is solveable.

cloneFunction

public Function cloneFunction()
Description copied from interface: Function
Returns a cloned instance that can be used freely. Might be same instance if it is static.

Specified by:
cloneFunction in interface Function
Returns:
A cloned instance that can be used freely.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.