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