package com.oozinoz.function;

public class Arithmetic extends Function 
{
	protected char operator;
/**
 * Construct an arithmetic function that decorates the 
 * provided source functions.
 *
 * @param char the operator to apply (+ - * /)
 *
 * @param Function the first source function that this
 *                 function wraps
 *
 * @param Function the second source function 
 */
public Arithmetic(
	char operator,
	Function f1,
	Function f2)
{
	super(new Function[] { f1, f2 });
	this.operator = operator;
}
/**
 * Return the result of applying this objects' arithmetic 
 * operator (+ - * /) to the source functions' values
 * at time t.
 *
 * @param t the time function that goes 0 to 1 and that
 *          other functions use as a parameter
 *
 * @return the result of applying this objects' arithmetic 
 *         operator (+ - * /) to the source functions' values
 *         at time t
 */
public double f(double t)
{
	switch (operator)
	{
		case '+' :
			return source[0].f(t) + source[1].f(t);
		case '-' :
			return source[0].f(t) - source[1].f(t);
		case '*' :
			return source[0].f(t) * source[1].f(t);
		case '/' :
			return source[0].f(t) / source[1].f(t);
		default :
			return 0;
	}
}
}

@@ -98,809 +98,138 @@
 or;%0A
-/**%0A * Construct an arithmetic function that decorates the %0A * provided source functions.%0A *%0A * @param char the operator to apply (+ - * /)%0A *%0A * @param Function the first source function that this%0A *                 function wraps%0A *%0A * @param Function the second source function %0A */%0Apublic Arithmetic(%0A%09char operator,%0A%09Function f1,%0A%09Function f2)%0A%7B%0A%09super(new Function%5B%5D %7B f1, f2 %7D);%0A%09this.operator = operator;%0A%7D%0A/**%0A * Return the result of applying this objects' arithmetic %0A * operator (+ - * /) to the source functions' values%0A * at time t.%0A *%0A * @param t the time function that goes 0 to 1 and that%0A *          other functions use as a parameter%0A *%0A * @return the result of applying this objects' arithmetic %0A *         operator (+ - * /) to the source functions' values%0A *         at time t%0A */
+%0Apublic Arithmetic(%0A%09char operator,%0A%09Function f1,%0A%09Function f2)%0A%7B%0A%09super(new Function%5B%5D %7B f1, f2 %7D);%0A%09this.operator = operator;%0A%7D%0A
 %0Apub

Update Arithmetic.java