1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-23 16:00:09 -08:00

Add an abstact class for external functions

This commit is contained in:
Mitchell 2017-07-25 11:14:59 -07:00
parent 3b91304175
commit 20b77430a9

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();
}