[Mathlib-commitlog] SF.net SVN: mathlib:[712] JMathLib/trunk/src/jmathlib/toolbox/jmathlib/ system
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-21 19:32:49
|
Revision: 712
http://mathlib.svn.sourceforge.net/mathlib/?rev=712&view=rev
Author: st_mueller
Date: 2009-01-21 19:32:46 +0000 (Wed, 21 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java
JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java 2009-01-21 19:31:17 UTC (rev 711)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/format.java 2009-01-21 19:32:46 UTC (rev 712)
@@ -1,6 +1,7 @@
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.tokens.OperandToken;
@@ -14,7 +15,7 @@
@param operand[0] = the name of the variable
@param operand[1] = a default value (optional)
@return the enviroment value*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = null;
@@ -34,23 +35,23 @@
//setNumberFormat(DecimalFormat.getInstance(Locale.ENGLISH));
if (type.equals("short"))
- setNumberFormat(new DecimalFormat("0.0000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.0000", new DecimalFormatSymbols(Locale.ENGLISH)));
else if (type.equals("long"))
- setNumberFormat(new DecimalFormat("0.000000000000000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.000000000000000", new DecimalFormatSymbols(Locale.ENGLISH)));
else if (type.equals("short e"))
- setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
else if (type.equals("long e"))
- setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
else if (type.equals("short g"))
- setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
else if (type.equals("long g"))
- setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
else if (type.equals("short eng"))
- setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.0000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
else if (type.equals("long eng"))
- setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.000000000000000E000", new DecimalFormatSymbols(Locale.ENGLISH)));
else
- setNumberFormat(new DecimalFormat("0.0000", new DecimalFormatSymbols(Locale.ENGLISH)));
+ globals.setNumberFormat(new DecimalFormat("0.0000", new DecimalFormatSymbols(Locale.ENGLISH)));
return result;
}
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java 2009-01-21 19:31:17 UTC (rev 711)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getenv.java 2009-01-21 19:32:46 UTC (rev 712)
@@ -13,7 +13,7 @@
@param operand[0] = the name of the variable
@param operand[1] = a default value (optional)
@return the enviroment value*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = null;
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java 2009-01-21 19:31:17 UTC (rev 711)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getglobalproperty.java 2009-01-21 19:32:46 UTC (rev 712)
@@ -1,6 +1,7 @@
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.tokens.OperandToken;
@@ -12,7 +13,7 @@
@param operand[0] = the name of the variable
@param operand[1] = a default value (optional)
@return the enviroment value*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = null;
@@ -27,7 +28,7 @@
String defaultVal = "";
- String property = getInterpreter().prefs.getGlobalProperty(name);
+ String property = globals.getInterpreter().prefs.getGlobalProperty(name);
result = new CharToken(property);
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java 2009-01-21 19:31:17 UTC (rev 711)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/getlocalproperty.java 2009-01-21 19:32:46 UTC (rev 712)
@@ -1,6 +1,7 @@
package jmathlib.toolbox.jmathlib.system;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.core.tokens.Token;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.tokens.OperandToken;
@@ -12,7 +13,7 @@
@param operand[0] = the name of the variable
@param operand[1] = a default value (optional)
@return the enviroment value*/
- public OperandToken evaluate(Token[] operands)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
OperandToken result = null;
@@ -27,7 +28,7 @@
String defaultVal = "";
- String property = getInterpreter().prefs.getLocalProperty(name);
+ String property = globals.getInterpreter().prefs.getLocalProperty(name);
result = new CharToken(property);
Modified: JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java
===================================================================
--- JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java 2009-01-21 19:31:17 UTC (rev 711)
+++ JMathLib/trunk/src/jmathlib/toolbox/jmathlib/system/java.java 2009-01-21 19:32:46 UTC (rev 712)
@@ -4,6 +4,7 @@
import jmathlib.core.tokens.OperandToken;
import jmathlib.core.tokens.CharToken;
import jmathlib.core.functions.ExternalFunction;
+import jmathlib.core.interpreter.GlobalValues;
import jmathlib.plugins.dynjava.JavaPlugin;
/**An example of an external function - it returns the first parameter*/
@@ -12,13 +13,13 @@
/**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)
+ public OperandToken evaluate(Token[] operands, GlobalValues globals)
{
// load java plugin
- getPluginsManager().addPlugin("JavaPlugin");
+ globals.getPluginsManager().addPlugin("JavaPlugin");
- String result = ((JavaPlugin)getPluginsManager().getPlugin("JavaPlugin")).executeJavaExpression(operands[0].toString());
+ String result = ((JavaPlugin)globals.getPluginsManager().getPlugin("JavaPlugin")).executeJavaExpression(operands[0].toString());
return new CharToken(result);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|