aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/function/Function.java
blob: f277228b338b427ee506e0c6ef67fea0a9415b74 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package jcgp.backend.function;

/**
 * Function is a callback wrapper. 
 * <br><br>
 * A concrete implementation of Function overrides {@code run()} to perform
 * any arbitrary operation on the arguments specified. It must also override
 * {@code getArity()} to return the function arity.
 * 
 * @author Eduardo Pedroni
 */
public abstract class Function {
	
	/**
	 * Executes the function.
	 * 
	 * @param args the function arguments.
	 * @return the function result.
	 */
	public abstract Object run(Object... arguments);
	
	/**
	 * @return the arity of the function.
	 */
	public abstract int getArity();
}