[Mathlib-commitlog] SF.net SVN: mathlib:[733] JMathLib/trunk/src/jmathlib/core/interpreter/ RootObj
Status: Beta
Brought to you by:
st_mueller
|
From: <st_...@us...> - 2009-01-23 20:29:25
|
Revision: 733
http://mathlib.svn.sourceforge.net/mathlib/?rev=733&view=rev
Author: st_mueller
Date: 2009-01-23 20:29:16 +0000 (Fri, 23 Jan 2009)
Log Message:
-----------
changed signature of evaluate(Token[] operands)
to
evaluate(Token[] operands, GlobalValues globals)
Modified Paths:
--------------
JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
Modified: JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java
===================================================================
--- JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2009-01-23 20:23:41 UTC (rev 732)
+++ JMathLib/trunk/src/jmathlib/core/interpreter/RootObject.java 2009-01-23 20:29:16 UTC (rev 733)
@@ -1,143 +1,43 @@
package jmathlib.core.interpreter;
import java.io.*;
-import java.text.NumberFormat;
-import java.applet.Applet;
-import jmathlib.core.interpreter.Interpreter;
import jmathlib.core.tokens.OperandToken;
-import jmathlib.core.functions.FunctionManager;
-/**This universal the base class for all class define by MathLib.
+/**This universal the base class for all class define by JMathLib.
It defines Global values as class variables and also defines functions for creating and accessing the working environment.*/
-abstract public class RootObject implements java.io.Serializable,
- java.lang.Cloneable,
- jmathlib.core.constants.ErrorCodes,
- jmathlib.core.constants.TokenConstants
+public class RootObject implements java.io.Serializable,
+ java.lang.Cloneable,
+ jmathlib.core.constants.ErrorCodes,
+ jmathlib.core.constants.TokenConstants
{
- /**store all the global values*/
- static transient private GlobalValues globals = null;
-
- /**Convert the object into a string*/
+ /**
+ *
+ */
+ public RootObject()
+ {
+ }
+
+ /**Convert the object into a string
+ * @param
+ */
public String toString()
{
return "";
}
/**Converts the object to a string based on the operand list
- @param operands = operands for the expression*/
+ * @param operands = operands for the expression
+ */
public String toString(OperandToken[] operands)
{
return "root object";
}
- /**Set the constant values
- @param _runnginStandalone = true if this is an application
- @param _interpreter = the interpreter object
- */
- protected final void setConstants(boolean _runningStandalone, Interpreter _interpreter, Applet applet)
- {
- if(globals == null)
- {
- globals = new GlobalValues(_interpreter, _runningStandalone, applet);
- }
- }
- /**
- * @return the current variable list
- */
- protected final VariableList getLocalVariables()
- {
- return globals.getLocalVariables();
- }
-
- /**
- * @return the global variable list
- */
- protected final VariableList getGlobalVariables()
- {
- return globals.getGlobalVariables();
- }
-
- /**
- * @param
- * @return the variable from local or global workspace
- */
- protected final Variable getVariable(String name)
- {
- return globals.getVariable(name);
- }
-
- /** create a variable in the local or global workspace
- * @param
- * @return
- */
- protected final Variable createVariable(String name)
- {
- return globals.createVariable(name);
- }
-
- /** set a variable in the local workspace
- * @param
- * @param
- */
- protected final void setVariable(String name, OperandToken value)
- {
- globals.setVariable(name, value);
- }
-
- /** Allow access to the context list
- * @return
- */
- protected final ContextList getContextList()
- {
- return globals.getContextList();
- }
-
- /**
- * @return the interpreter object
- */
- protected final Interpreter getInterpreter()
- {
- return globals.getInterpreter();
- }
-
- /**
- * @return the function manager
- */
- public final FunctionManager getFunctionManager()
- {
- return globals.getFunctionManager();
- }
-
- /**@return handle to plugins manager*/
- protected jmathlib.plugins.PluginsManager getPluginsManager()
- {
- return globals.getPluginsManager();
- }
-
- /** @return actual working directory */
- protected File getWorkingDirectory()
- {
- return globals.getWorkingDirectory();
- }
-
- /** Sets the base directory used for all file operations
- @param _workingDir = the working directory to use*/
- protected void setWorkingDirectory(File _workingDir)
- {
- globals.setWorkingDirectory( _workingDir);
- }
-
- /**@return handle to graphics manager*/
- protected jmathlib.core.graphics.GraphicsManager getGraphicsManager()
- {
- return globals.getGraphicsManager();
- }
-
-
/**Duplicates the object by serialising it to a piped stream then reading it back into
- the new object*/
+ * the new object
+ */
public Object clone()
{
@@ -174,47 +74,17 @@
}
catch(java.io.IOException except)
{
- ErrorLogger.debugLine("IO exception");
+ ErrorLogger.debugLine("RootObject: IO exception");
ErrorLogger.debugLine(except.getMessage());
//except.printStackTrace();
}
catch(java.lang.ClassNotFoundException except)
{
- ErrorLogger.debugLine("Class not found exception");
+ ErrorLogger.debugLine("RootObject: Class not found exception");
}
return copy;
}
- /**@return the setting of the debug flag*/
- static public final boolean getDebug()
- {
- return globals.getDebug();
- }
-
- /**sets the debug flag
- @param _debug = should debug information be displayed*/
- static public final void setDebug(boolean _debug)
- {
- globals.setDebug(_debug);
- }
- /**
- * returns the number format for displaying numbers
- * @return format type
- */
- public NumberFormat getNumberFormat()
- {
- return globals.getNumberFormat();
- }
-
- /**
- * sets the number format for displaying numbers
- * @param _numFormat format type
- */
- public void setNumberFormat(NumberFormat numFormat)
- {
- globals.setNumberFormat(numFormat);
- }
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|