1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-22 07:20:09 -08:00

Add an abstact class for external functions

This commit is contained in:
Riley Jones 2017-07-25 11:14:59 -07:00
parent 3b91304175
commit e99afa0507

View File

@ -0,0 +1,28 @@
package org.nwapw.abacus.number;
import java.util.HashMap;
public abstract class externalFunction {
private HashMap<String, Function> functions;
public externalFunction(){
functions=new HashMap<>();
}
public boolean hasFunction(Function x){
return functions.containsKey(x);
}
public Function getFunction(String x){
return functions.get(x);
}
public boolean registerFunction(String x, Function y){
if(!functions.containsKey(x))
return functions.put(x,y)==null;
return false;
}
public Function functionFor(String x){
return null;
}
public abstract void load();
}