From 691118c20694665c3683e9c0e37b9573424b76e1 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 3 Aug 2017 10:25:10 -0700 Subject: [PATCH] Add a number provider cache. --- src/main/java/org/nwapw/abacus/plugin/PluginManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/nwapw/abacus/plugin/PluginManager.java b/src/main/java/org/nwapw/abacus/plugin/PluginManager.java index e3c6dcb..141adbd 100644 --- a/src/main/java/org/nwapw/abacus/plugin/PluginManager.java +++ b/src/main/java/org/nwapw/abacus/plugin/PluginManager.java @@ -2,6 +2,7 @@ package org.nwapw.abacus.plugin; import org.nwapw.abacus.function.Function; import org.nwapw.abacus.function.Operator; +import org.nwapw.abacus.number.NaiveNumber; import org.nwapw.abacus.number.NumberInterface; import java.lang.reflect.InvocationTargetException; @@ -36,6 +37,11 @@ public class PluginManager { * been cached, that is, found in a plugin and returned. */ private Map> cachedNumbers; + /** + * List of registered constant providers for every + * number class. + */ + private Map, java.util.function.Function> cachedConstantProviders; /** * List of all functions loaded by the plugins. */ @@ -62,6 +68,7 @@ public class PluginManager { cachedFunctions = new HashMap<>(); cachedOperators = new HashMap<>(); cachedNumbers = new HashMap<>(); + cachedConstantProviders = new HashMap<>(); allFunctions = new HashSet<>(); allOperators = new HashSet<>(); allNumbers = new HashSet<>();