Step 5 - Implement Functions/Variables in Java™
(Plug-in Development)
To expand RINPn's functionality, let's implement plug-ins in the Java programming language.
Sponsored Link
You can implement new built-in variables and functions using the Java™ programming language. Within RINPn and Vnano, we refer to Java™ programs that provide built-in functions or variables as "plugins."
Utilizing Java offers advanced functionality compared to defining variables/functions in script code (as in step-4).
However, implementing code in Java requires the Java Development Kit (JDK) to compile the code. We assume that JDK is installed on your PC and that the "javac" command is available. For installation details, you can search online with keywords like "OpenJDK install (your OS name)".
How to Use Plugins
To use plugins with RINPn, place them in the "plugin" folder of RINPn. A simple example of a plugin, "ExamplePlugin.java," is located in this folder:
public class ExamplePlugin {
public double pivar = 1.0;
public double pifun(double arg) {
return arg * 2.0;
}
}
This plugin is compiled by default and set to be loaded (details on setting this up will be explained later).
The variable "pivar" and the method "pifun(arg)" can be used as built-in variables/functions in the calculator (see Step-1 and 2) and in script code (see Steps-3 and 4).
For example:
1 + pivar
OUTPUT:
2
INPUT:
pifun(2)
OUTPUT:
4
How to Compile Plugins
When you modify a plugin's code, it needs to be recompiled as follows:
javac ExamplePlugin.vnano
Some compiled class files of special plugin interfaces (XFCI1, XNCI1, etc.) supported by the Vnano Engine are included in the "plugin/org/vcssl/connect" folder. You can import these interfaces in your plugin and compile them similarly.
How to Add New Plugins
To add a new plugin, place it in the "plugin" folder and compile it. Then, add the path of the compiled class file to the "VnanoPluginList.txt" file within the "plugin" folder. All plugins listed in "VnanoPluginList.txt" will be loaded by RINPn.
Vnano Standard Plugins
In the "plugin/org/vcssl/nano/plugin" folder, "Vnano Standard Plugins," which provide basic features like math and utility functions, are bundled and loaded by default (as specified in "VnanoPluginList.txt"). You can use their functions and variables by default.
For a comprehensive list and detailed specifications of Vnano Standard Plugins, visit the "Vnano Standard Plugins" page on the official Vnano website.
Additionally, the RINPn frequently uses functions/variables, and simplified explanations of these are listed in the section: Appendix - List of Built-in Functions/Variables..
- Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- Microsoft Windows is either a registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.
- Linux is a trademark of linus torvalds in the United States and/or other countries.
- Other names may be either a registered trademarks or trademarks of their respective owners.
Author of This Article
[ Founder of RINEARN, Doctor of Science (Physics), Applied Info Tech Engineer ]
Translation Cooperator
[ GPT-3.5, 4, 5, 5.1 ]
- Introduction - Overview of RINPn and How to Get Started
- Step 1 - Using RINPn in GUI Mode
- Step 2 - Using RINPn in CUI Mode (Command-Line Terminal)
- Step 3 - How to Execute Scripts
- Step 4 - How to Add Functions/Variables by Scripts (Library Scripts)
- Step 5 - Implement Functions/Variables in Java™ (Plug-in Development)
- Step 6 - How to Embed into Other Software
- Appendix - List of Built-in Functions/Variables









