net.sf.jga.fn.arithmetic
public class Negate<T extends Number> extends AbstractUnaryFunctor<T,T> implements Serializable
Copyright © 2003 David A. Hall
Nested Class Summary | |
---|---|
interface | Negate.Visitor
Interface for classes that may interpret a Negate functor. |
Constructor Summary | |
---|---|
Negate(Class c)
Builds Negate functor for the given class. |
Method Summary | |
---|---|
void | accept(Visitor v)
Calls the Visitor's visit(Negate) method, if it implements
the nested Visitor interface. |
T | fn(T x)
Given numeric argument x, returns -x |
String | toString() |
Throws: IllegalArgumentException if the given class has no Arithmetic implementation registered with the ArithmeticFactory
visit(Negate)
method, if it implements
the nested Visitor interface.Returns: the negative of its numeric argument