jmathlib.core.interpreter
Class GlobalValues

java.lang.Object
  extended by jmathlib.core.interpreter.GlobalValues

public class GlobalValues
extends java.lang.Object

This class contains the global variables, which are accessible throughout the program. These include System flags The list of contexts The interpreter object The GraphicsManager The working directory These values are all private and should be access through the getter/setter functions


Field Summary
private  ContextList contextList
          A list of contexts
private  FunctionManager functionManager
          Object to control function usage
private  GraphicsManager graphicsManager
          Object to control graphical output
private  Interpreter interpreter
          A pointer to the interpreter itself
private  java.text.NumberFormat numFormat
          stores the number format for displaying the number
private  PluginsManager pluginsManager
          Object to control plugins
private static java.util.Properties props
          global properties
private  boolean runningStandalone
          flag to indicate if JMathLib is running standalone or as applet,servlet
 
Constructor Summary
GlobalValues(Interpreter _interpreter, boolean _runningStandalone)
          Initialises the global values
 
Method Summary
 void createContext(VariableList _variables)
          Change the current context to point to the new Variable List
 Variable createVariable(java.lang.String name)
          Create a variable in the local or global workspace
 ContextList getContextList()
          Allow access to the context list
 FunctionManager getFunctionManager()
          Returns a handle to the function manager
 VariableList getGlobalVariables()
           
 GraphicsManager getGraphicsManager()
          Returns a handle to the graphics manager
 Interpreter getInterpreter()
          Returns the interpreter object
 VariableList getLocalVariables()
           
 java.text.NumberFormat getNumberFormat()
          returns the number format for displaying numbers
 PluginsManager getPluginsManager()
          Returns a handle to the plugin manager
 java.lang.String getProperty(java.lang.String property)
          Returns one of JMathLib's properties
 Variable getVariable(java.lang.String name)
           
 java.io.File getWorkingDirectory()
          Returns the working directory
 void loadPropertiesFromFile()
          load JMathLib properties from a file or in applet version from the web server.
 void popContext()
          Return to the previous variable list
 void setNumberFormat(java.text.NumberFormat _numFormat)
          sets the number format for displaying numbers
 void setProperty(java.lang.String property, java.lang.String value)
          Sets a property of JMathLib
 void setVariable(java.lang.String name, OperandToken value)
          Create a variable in the local or global workspace
 void setWorkingDirectory(java.io.File _workingDir)
          Sets the working directory
 void storePropertiesToFile()
          store properties back to a file on disc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextList

private ContextList contextList
A list of contexts


runningStandalone

private boolean runningStandalone
flag to indicate if JMathLib is running standalone or as applet,servlet


functionManager

private FunctionManager functionManager
Object to control function usage


interpreter

private Interpreter interpreter
A pointer to the interpreter itself


graphicsManager

private GraphicsManager graphicsManager
Object to control graphical output


pluginsManager

private PluginsManager pluginsManager
Object to control plugins


numFormat

private java.text.NumberFormat numFormat
stores the number format for displaying the number


props

private static java.util.Properties props
global properties

Constructor Detail

GlobalValues

public GlobalValues(Interpreter _interpreter,
                    boolean _runningStandalone)
Initialises the global values

Parameters:
_interpreter - = the Interpreter object
_runningStandalone - = true if this was run from an application
Method Detail

getLocalVariables

public VariableList getLocalVariables()
Returns:
the current variable list

getGlobalVariables

public VariableList getGlobalVariables()
Returns:
the global variable list

getVariable

public Variable getVariable(java.lang.String name)
Parameters:
-
Returns:
the a variable from local or global workspace

createVariable

public Variable createVariable(java.lang.String name)
Create a variable in the local or global workspace

Parameters:
creates - a new variable
Returns:
returns the handle to that variable

setVariable

public void setVariable(java.lang.String name,
                        OperandToken value)
Create a variable in the local or global workspace

Parameters:
name - of the variable
data - of the variable

createContext

public void createContext(VariableList _variables)
Change the current context to point to the new Variable List

Parameters:
_Variables - = the new list of Variables to use

popContext

public void popContext()
Return to the previous variable list


getContextList

public ContextList getContextList()
Allow access to the context list

Returns:
the context list

getInterpreter

public Interpreter getInterpreter()
Returns the interpreter object

Returns:
pointer to Interpreter

getFunctionManager

public FunctionManager getFunctionManager()
Returns a handle to the function manager

Returns:
the function manager

getGraphicsManager

public GraphicsManager getGraphicsManager()
Returns a handle to the graphics manager

Returns:
handle to graphics manager

getPluginsManager

public PluginsManager getPluginsManager()
Returns a handle to the plugin manager

Returns:
handle to plugins manager

getWorkingDirectory

public java.io.File getWorkingDirectory()
Returns the working directory

Returns:
actual working directory

setWorkingDirectory

public void setWorkingDirectory(java.io.File _workingDir)
Sets the working directory

Parameters:
set - working directory

getNumberFormat

public java.text.NumberFormat getNumberFormat()
returns the number format for displaying numbers

Returns:
format type

setNumberFormat

public void setNumberFormat(java.text.NumberFormat _numFormat)
sets the number format for displaying numbers

Parameters:
_numFormat - format type

loadPropertiesFromFile

public void loadPropertiesFromFile()
load JMathLib properties from a file or in applet version from the web server.


storePropertiesToFile

public void storePropertiesToFile()
store properties back to a file on disc. In applet version do not store, since there is no disc


getProperty

public java.lang.String getProperty(java.lang.String property)
Returns one of JMathLib's properties

Parameters:
property -
Returns:
string value of the requested property

setProperty

public void setProperty(java.lang.String property,
                        java.lang.String value)
Sets a property of JMathLib

Parameters:
name - of property
value - of property

FOOTER

BOTTOM