jmathlib.core.interpreter
Class RootObject

java.lang.Object
  extended by jmathlib.core.interpreter.RootObject
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ErrorCodes, TokenConstants
Direct Known Subclasses:
ErrorLogger, Function, FunctionParser, Interpreter, MFileLoader, Parser, Token, TreeAnalyser, Variable

public abstract class RootObject
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, ErrorCodes, TokenConstants

This universal the base class for all class define by MathLib. It defines Global values as class variables and also defines functions for creating and accessing the working environment.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface jmathlib.core.constants.ErrorCodes
ERR_BRACKET_OPEN, ERR_BRACKET_ORDER, ERR_FUNCTION_NOT_FOUND, ERR_FUNCTION_NOT_IMPLEMENTED, ERR_INSUFFICIENT_PARAMETERS, ERR_INVALID_PARAMETER, ERR_LVALUE_REQUIRED, ERR_MATRIX_SINGULAR, ERR_NOT_SQUARE_MATRIX, ERR_OPNOTSUPPORTED, ERR_TOO_MANY_PARAMETERS, ERR_USER_ERROR, ERR_VARIABLE_NOTDEFINED, OK, OK_FUNCTION_PROCESS
 
Fields inherited from interface jmathlib.core.constants.TokenConstants
ADDSUB_PRIORITY, AND_PRIORITY, ANDAND_PRIORITY, ASSIGN_PRIORITY, BRACKET_PRIORITY, COMPARE_PRIORITY, CONCAT, MATRIX, MULDIV_PRIORITY, OR_PRIORITY, OROR_PRIORITY, PARAMETER, POWER_PRIORITY, RELATION_PRIORITY, SINGLE, ttDelimiter, ttNotSet, ttOperand, ttOperator
 
Constructor Summary
RootObject()
           
 
Method Summary
 java.lang.Object clone()
          Duplicates the object by serialising it to a piped stream then reading it back into the new object
protected  ContextList getContextList()
          Allow access to the context list
static boolean getDebug()
           
 FunctionManager getFunctionManager()
           
protected  VariableList getGlobalVariables()
           
protected  GraphicsManager getGraphicsManager()
           
protected  Interpreter getInterpreter()
           
protected  PluginsManager getPluginsManager()
           
protected  Variable getVariable(java.lang.String name)
           
protected  VariableList getVariables()
           
protected  java.io.File getWorkingDirectory()
           
protected  void setConstants(boolean _runningStandalone, Interpreter _interpreter, java.applet.Applet applet)
          Set the constant values
static void setDebug(boolean _debug)
          sets the debug flag
protected  void setWorkingDirectory(java.io.File _workingDir)
          Sets the base directory used for all file operations
 java.lang.String toString()
          Convert the object into a string
 java.lang.String toString(OperandToken[] operands)
          Converts the object to a string based on the operand list
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RootObject

public RootObject()
Method Detail

toString

public java.lang.String toString()
Convert the object into a string

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(OperandToken[] operands)
Converts the object to a string based on the operand list

Parameters:
operands - = operands for the expression

setConstants

protected final void setConstants(boolean _runningStandalone,
                                  Interpreter _interpreter,
                                  java.applet.Applet applet)
Set the constant values

Parameters:
_runnginStandalone - = true if this is an application
_interpreter - = the interpreter object

getVariables

protected final VariableList getVariables()
Returns:
the current variable list

getGlobalVariables

protected final VariableList getGlobalVariables()
Returns:
the global variable list

getVariable

protected final Variable getVariable(java.lang.String name)
Returns:
the global variable list

getContextList

protected final ContextList getContextList()
Allow access to the context list


getInterpreter

protected final Interpreter getInterpreter()
Returns:
the interpreter object

getFunctionManager

public final FunctionManager getFunctionManager()
Returns:
the function manager

getPluginsManager

protected PluginsManager getPluginsManager()
Returns:
handle to plugins manager

getWorkingDirectory

protected java.io.File getWorkingDirectory()
Returns:
actual working directory

setWorkingDirectory

protected void setWorkingDirectory(java.io.File _workingDir)
Sets the base directory used for all file operations

Parameters:
_workingDir - = the working directory to use

getGraphicsManager

protected GraphicsManager getGraphicsManager()
Returns:
handle to graphics manager

clone

public java.lang.Object clone()
Duplicates the object by serialising it to a piped stream then reading it back into the new object

Overrides:
clone in class java.lang.Object

getDebug

public static final boolean getDebug()
Returns:
the setting of the debug flag

setDebug

public static final void setDebug(boolean _debug)
sets the debug flag

Parameters:
_debug - = should debug information be displayed