1
0
mirror of https://github.com/DanilaFe/abacus synced 2026-01-10 17:25:19 +00:00

Move function into its own package.

This commit is contained in:
2017-07-25 21:57:14 -07:00
parent 08a462b8f3
commit 31b6adecd9
4 changed files with 6 additions and 5 deletions

View File

@@ -1,20 +0,0 @@
package org.nwapw.abacus.number;
import java.util.HashMap;
public abstract class Function {
private static final HashMap<Class<? extends NumberInterface>, Integer> priorityMap =
new HashMap<Class<? extends NumberInterface>, Integer>() {{
put(NaiveNumber.class, 0);
}};
protected abstract boolean matchesParams(NumberInterface[] params);
protected abstract NumberInterface applyInternal(NumberInterface[] params);
public NumberInterface apply(NumberInterface...params) {
if(!matchesParams(params)) return null;
return applyInternal(params);
}
}