diff --git a/src/main/java/org/nwapw/abacus/plugin/Plugin.java b/src/main/java/org/nwapw/abacus/plugin/Plugin.java index 7a78764..b92a9f4 100644 --- a/src/main/java/org/nwapw/abacus/plugin/Plugin.java +++ b/src/main/java/org/nwapw/abacus/plugin/Plugin.java @@ -1,5 +1,7 @@ package org.nwapw.abacus.plugin; +import org.nwapw.abacus.function.Documentation; +import org.nwapw.abacus.function.DocumentationType; import org.nwapw.abacus.function.Function; import org.nwapw.abacus.function.Operator; import org.nwapw.abacus.number.NumberInterface; @@ -94,6 +96,15 @@ public abstract class Plugin { manager.registerNumberImplementation(name, implementation); } + /** + * To be used in load(). Registers a documentation instance + * used to explain some element of the plugin to the user. + * @param documentation the documentation instance. + */ + protected final void registerDocumentation(Documentation documentation){ + manager.registerDocumentation(documentation); + } + /** * Searches the PluginManager for the given function name. * This can be used by the plugins internally in order to call functions @@ -130,6 +141,17 @@ public abstract class Plugin { return manager.numberImplementationFor(name); } + /** + * Searches the PluginManager for the given documentation name and type. + * + * @param name the name for which to search. + * @param type the type of documentation to search for. + * @return the found documentation, or null if none was found. + */ + protected final Documentation documentationFor(String name, DocumentationType type){ + return manager.documentationFor(name, type); + } + /** * Searches the plugin manager for a Pi value for the given number implementation. * This is done so that number implementations with various degrees of precision