com.miginfocom.ashape.animation
Class ExponentFunction

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

public class ExponentFunction
extends java.lang.Object
implements Function

A type of function to describe a function y = t^x.

See Also:
Serialized Form

Constructor Summary
ExponentFunction(double exponent)
           
 
Method Summary
 Function cloneFunction()
          Returns a cloned instance that can be used freely.
 boolean equals(java.lang.Object o)
           
 double f(double t)
          Re rurns x raised to the power of exponent, specified in the constructor
 double getExponent()
          Returns the number to raise the incoming number with.
 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

ExponentFunction

public ExponentFunction(double exponent)
Method Detail

f

public final double f(double t)
Re rurns x raised to the power of exponent, specified in the constructor

Specified by:
f in interface Function
Parameters:
t - The value
Returns:
x raised to the power of exponent, specified in the constructor

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 result or an empty array if no solutions between lo and hi. Neve null.

getExponent

public double getExponent()
Returns the number to raise the incoming number with.

Returns:
The number to raise the incoming number with.

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.