2017-08-03 20:50:53 -07:00
|
|
|
package org.nwapw.abacus.plugin;
|
|
|
|
|
|
|
|
import org.nwapw.abacus.number.NumberInterface;
|
|
|
|
|
2017-08-03 21:05:25 -07:00
|
|
|
import java.util.HashMap;
|
2017-08-03 20:50:53 -07:00
|
|
|
import java.util.Map;
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
|
|
|
public abstract class NumberImplementation {
|
|
|
|
|
|
|
|
private Class<? extends NumberInterface> implementation;
|
|
|
|
private Map<String, Function<NumberInterface, NumberInterface>> promotionPaths;
|
|
|
|
private int priority;
|
|
|
|
|
2017-08-03 21:05:25 -07:00
|
|
|
public NumberImplementation(Class<? extends NumberInterface> implementation, int priority){
|
|
|
|
this.implementation = implementation;
|
|
|
|
this.priority = priority;
|
|
|
|
promotionPaths = new HashMap<>();
|
|
|
|
}
|
|
|
|
|
2017-08-03 20:50:53 -07:00
|
|
|
public abstract NumberInterface instanceForString(String string);
|
|
|
|
public abstract NumberInterface instanceForPi();
|
|
|
|
|
|
|
|
}
|