aboutsummaryrefslogtreecommitdiffstats
path: root/src/jcgp/backend/function/Function.java
blob: 2e1f3c6cd2a85259dbc2d0ca956fe8f890f4cc72 (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... args);
	
	/**
	 * @return the arity of the function.
	 */
	public abstract int getArity();
}