mirror of
https://github.com/DanilaFe/abacus
synced 2026-01-28 09:35:19 +00:00
Add the number implementation to the plugin manager, and use it.
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nwapw.abacus.plugin;
|
||||
|
||||
import org.nwapw.abacus.number.NumberInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
@@ -11,6 +12,12 @@ public abstract class NumberImplementation {
|
||||
private Map<String, Function<NumberInterface, NumberInterface>> promotionPaths;
|
||||
private int priority;
|
||||
|
||||
public NumberImplementation(Class<? extends NumberInterface> implementation, int priority){
|
||||
this.implementation = implementation;
|
||||
this.priority = priority;
|
||||
promotionPaths = new HashMap<>();
|
||||
}
|
||||
|
||||
public abstract NumberInterface instanceForString(String string);
|
||||
public abstract NumberInterface instanceForPi();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user