⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 java.java

📁 JAVA 数学程序库 提供常规的数值计算程序包
💻 JAVA
字号:
package jmathlib.toolbox.jmathlib.system;

import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.functions.ExternalFunction;
import jmathlib.plugins.dynjava.JavaPlugin;

/**An example of an external function - it returns the first parameter*/
public class java extends ExternalFunction
{
	/**Executes the function - returning the first parameter
	@param operands - the array of parameters
	@return the result of the function as an OperandToken*/	
	public OperandToken evaluate(Token[] operands)
	{    
	    
        // load java plugin
        getPluginsManager().addPlugin("JavaPlugin");
        
        String result = ((JavaPlugin)getPluginsManager().getPlugin("JavaPlugin")).executeJavaExpression(operands[0].toString());

	    return new CharToken(result);
	}
}



/*

java('console.displayText("hello world");')
hello world
ans = null

To access a JMathLib variable enter
x=5
JAVA('global.getVariable("x");')
ans = 5

*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -