Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hartmath.lib
Class Session  view Session download Session.java

java.lang.Object
  extended bycom.hartmath.lib.Session

public class Session
extends java.lang.Object

Defines the 'Session' or 'NameSpace' for an evalution. This class can be mapped in servlets to distinguish different SessionIDs.


Field Summary
private  int count
           
private  int digits
           
private  java.io.Writer errorOut
           
private  boolean holdNumericEvaluationFlag
           
private  com.hartmath.expression.HArrayList InArray
           
private  int IOCounter
          couner for IOOut or IOIn
private  java.util.HashMap IOIn
          contains expressions for ReadObject()
private  java.util.HashMap IOOut
          contains expressions for WriteObject()
private  int iterationCounter
           
private  int iterationLimit
           
private  com.hartmath.expression.HFunction lastTraceList
           
private static java.lang.String lineSeparator
           
private  boolean numericFlag
           
private  com.hartmath.expression.HArrayList OutArray
           
private  int recursionCounter
           
private  int recursionLimit
           
private  java.io.Writer resultOut
           
private  java.util.HashMap SymbolDataSet
          contains the all symbol to symbolData mappings for a particular session
private  boolean traceEval
           
 
Constructor Summary
Session()
          Constructor for the S object
 
Method Summary
 void addHistory()
          Adds a feature to the History attribute of the S object
 com.hartmath.expression.HSymbol addSymbolData(com.hartmath.expression.HSymbol sym)
          Adds a symbol to the SymbolData attribute of the S object
 com.hartmath.expression.HSymbol addSymbolData(com.hartmath.expression.HSymbol sym, int attributes)
          Adds a feature to the SymbolData attribute of the S object
 void appendErrorOut(java.lang.String str)
          Description of the Method
 void appendLineErrorOut(java.lang.String str)
          Description of the Method
 void appendLineResultOut(java.lang.String str)
          Description of the Method
 void appendResultOut(java.lang.String str)
          Description of the Method
 void changeCurrentInHistory(com.hartmath.expression.HObject obj)
          Description of the Method
 void changeCurrentOutHistory(com.hartmath.expression.HObject obj)
          Description of the Method
 void clearIOIn()
          Description of the Method
 void clearIOOut()
          Description of the Method
 void createLocalPattern(com.hartmath.expression.HSymbol sym, com.hartmath.expression.HObject obj)
          Description of the Method
 void createLocalVar(com.hartmath.expression.HSymbol sym, com.hartmath.expression.HObject obj)
          Description of the Method
 void decIterationCounter()
          Description of the Method
 void decRecursionCounter()
          Description of the Method
 com.hartmath.expression.HObject deleteLocalPattern(com.hartmath.expression.HSymbol sym)
          Description of the Method
 com.hartmath.expression.HObject deleteLocalVar(com.hartmath.expression.HSymbol sym)
          Description of the Method
 com.hartmath.expression.HObject ELoop(com.hartmath.expression.HObject obj)
          Description of the Method
 com.hartmath.expression.HObject EV(com.hartmath.expression.HObject obj)
          Symbolic evaluation
 void flushBuffers()
          Description of the Method
 int getCounter()
          Gets the counter attribute of the S object
 int getDigits()
          Gets the digits attribute of the S object
 boolean getHoldNumericEvaluationFlag()
          Gets the holdNumericEvaluationFlag attribute of the Session object
 com.hartmath.expression.HObject getInHistory(int cnt)
          Gets the inHistory attribute of the S object
 int getIOCounter()
          Gets the iOCounter attribute of the S object
 com.hartmath.expression.HSymbol getIOIn(java.lang.Integer num)
          Gets the iOIn attribute of the S object
 java.lang.Short getIOOut(java.lang.String str)
          Gets the iOOut attribute of the S object
 int getIterationLimit()
          Gets the iterationLimit attribute of the S object
 com.hartmath.expression.HObject getLocalPatternValue(com.hartmath.expression.HSymbol sym)
          Gets the localPatternValue attribute of the S object
 com.hartmath.expression.HObject getLocalVarValue(com.hartmath.expression.HSymbol sym)
          Gets the localVarValue attribute of the S object
 boolean getNumericFlag()
          Gets the numericFlag attribute of the S object
 com.hartmath.expression.HObject getOutHistory(int cnt)
          Gets the outHistory attribute of the S object
 int getRecursionLimit()
          Gets the recursionLimit attribute of the S object
 com.hartmath.expression.HSymbolData getSymbolData(com.hartmath.expression.HSymbol sym)
          Gets the symbolData attribute of the S object
 boolean getTraceEval()
          Gets the traceEval attribute of the S object
 com.hartmath.expression.HFunction getTraceList()
          Gets the traceList attribute of the S object
 boolean hasNoLocalPattern(com.hartmath.expression.HSymbol sym)
          Description of the Method
 boolean hasNoLocalVar(com.hartmath.expression.HSymbol sym)
          Description of the Method
 void incIOCounter()
          Description of the Method
 void incIterationCounter()
          Description of the Method
 void incRecursionCounter()
          Description of the Method
 java.lang.String interpreter(java.lang.String expr)
           
 java.lang.String interpreter(java.lang.String expr, boolean quietMode)
           
 java.lang.String interpreter(java.lang.String expr, com.hartmath.expression.HFunction conv, boolean quietMode)
           
 boolean iterationExceeded()
          Description of the Method
 com.hartmath.expression.HObject NEV(com.hartmath.expression.HObject obj)
          Numerical evaluation [sets numericFlag=true]
 com.hartmath.expression.HObject objectInterpreter(java.lang.String expression, boolean convertResult, boolean quietMode)
          evaluate the expression
 com.hartmath.expression.HObject objectInterpreter(java.lang.String expression, com.hartmath.expression.HFunction conversionFunction, boolean convertResult, boolean quietMode)
          evaluate the expression
 com.hartmath.expression.HObject objectInterpreter(java.lang.String expr, com.hartmath.expression.HFunction conv, boolean rethrowError, boolean convertResult, boolean quietMode)
          evaluate the expression
 void putIOIn(java.lang.Integer num, com.hartmath.expression.HSymbol obj)
          Description of the Method
 void putIOOut(java.lang.String str, java.lang.Short num)
          Description of the Method
 boolean recursionExceeded()
          Description of the Method
 void resetTraceList()
          Resets the traceList attribute of the S object
 void setDigits(int dig)
          Sets the digits attribute of the S object
 void setErrorOut(java.io.Writer out)
          Sets the errorOut attribute of the S object
 void setHoldNumericEvaluationFlag(boolean holdNumericEvaluationFlag)
          Sets the holdNumericEvaluationFlag attribute of the Session object
 void setIOCounter(int cnt)
          Sets the iOCounter attribute of the S object
 void setIterationCounter(int cnt)
          Sets the iterationCounter attribute of the S object
 void setIterationLimit(int l)
          Sets the iterationLimit attribute of the S object
 void setNumericFlag(boolean numericFlag)
          Sets the numericFlag attribute of the S object
 void setRecursionCounter(int cnt)
          Sets the recursionCounter attribute of the S object
 void setRecursionLimit(int l)
          Sets the recursionLimit attribute of the S object
 void setResultOut(java.io.Writer out)
          Sets the resultOut attribute of the S object
 com.hartmath.expression.HObject setRules(long[] larr, byte[] barr)
          Sets the rules attribute of the S object
 void setSymbolData(com.hartmath.expression.HSymbol sym)
          Sets the symbolData attribute of the S object
 void setSymbolData(com.hartmath.expression.HSymbol sym, com.hartmath.expression.HSymbolFunctionData dSet)
          Sets the symbolData attribute of the S object
 void setSymbolData(com.hartmath.expression.HSymbol sym, int attributes)
          Sets the symbolData attribute of the S object
 void setTraceEval(boolean flag)
          Sets the traceEval attribute of the S object
 void setTraceList(com.hartmath.expression.HFunction list)
          Sets the traceList attribute of the S object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numericFlag

private boolean numericFlag

holdNumericEvaluationFlag

private boolean holdNumericEvaluationFlag

traceEval

private boolean traceEval

lastTraceList

private com.hartmath.expression.HFunction lastTraceList

recursionLimit

private int recursionLimit

iterationLimit

private int iterationLimit

recursionCounter

private int recursionCounter

iterationCounter

private int iterationCounter

digits

private int digits

count

private int count

InArray

private com.hartmath.expression.HArrayList InArray

OutArray

private com.hartmath.expression.HArrayList OutArray

resultOut

private java.io.Writer resultOut

errorOut

private java.io.Writer errorOut

IOCounter

private int IOCounter
couner for IOOut or IOIn


IOOut

private java.util.HashMap IOOut
contains expressions for WriteObject()


IOIn

private java.util.HashMap IOIn
contains expressions for ReadObject()


SymbolDataSet

private java.util.HashMap SymbolDataSet
contains the all symbol to symbolData mappings for a particular session


lineSeparator

private static java.lang.String lineSeparator
Constructor Detail

Session

public Session()
Constructor for the S object

Method Detail

setNumericFlag

public final void setNumericFlag(boolean numericFlag)
Sets the numericFlag attribute of the S object


setHoldNumericEvaluationFlag

public final void setHoldNumericEvaluationFlag(boolean holdNumericEvaluationFlag)
Sets the holdNumericEvaluationFlag attribute of the Session object


setRecursionLimit

public final void setRecursionLimit(int l)
Sets the recursionLimit attribute of the S object


setIterationLimit

public final void setIterationLimit(int l)
Sets the iterationLimit attribute of the S object


setRecursionCounter

public final void setRecursionCounter(int cnt)
Sets the recursionCounter attribute of the S object


setIterationCounter

public final void setIterationCounter(int cnt)
Sets the iterationCounter attribute of the S object


setDigits

public final void setDigits(int dig)
Sets the digits attribute of the S object


setResultOut

public final void setResultOut(java.io.Writer out)
Sets the resultOut attribute of the S object


setErrorOut

public final void setErrorOut(java.io.Writer out)
Sets the errorOut attribute of the S object


setIOCounter

public final void setIOCounter(int cnt)
Sets the iOCounter attribute of the S object


setSymbolData

public final void setSymbolData(com.hartmath.expression.HSymbol sym,
                                com.hartmath.expression.HSymbolFunctionData dSet)
Sets the symbolData attribute of the S object


setSymbolData

public final void setSymbolData(com.hartmath.expression.HSymbol sym)
Sets the symbolData attribute of the S object


setSymbolData

public final void setSymbolData(com.hartmath.expression.HSymbol sym,
                                int attributes)
Sets the symbolData attribute of the S object


setRules

public com.hartmath.expression.HObject setRules(long[] larr,
                                                byte[] barr)
Sets the rules attribute of the S object


setTraceEval

public void setTraceEval(boolean flag)
Sets the traceEval attribute of the S object


setTraceList

public void setTraceList(com.hartmath.expression.HFunction list)
Sets the traceList attribute of the S object


getNumericFlag

public final boolean getNumericFlag()
Gets the numericFlag attribute of the S object


getHoldNumericEvaluationFlag

public final boolean getHoldNumericEvaluationFlag()
Gets the holdNumericEvaluationFlag attribute of the Session object


getRecursionLimit

public final int getRecursionLimit()
Gets the recursionLimit attribute of the S object


getIterationLimit

public final int getIterationLimit()
Gets the iterationLimit attribute of the S object


getDigits

public final int getDigits()
Gets the digits attribute of the S object


getInHistory

public final com.hartmath.expression.HObject getInHistory(int cnt)
Gets the inHistory attribute of the S object


getOutHistory

public final com.hartmath.expression.HObject getOutHistory(int cnt)
Gets the outHistory attribute of the S object


getCounter

public final int getCounter()
Gets the counter attribute of the S object


getIOCounter

public final int getIOCounter()
Gets the iOCounter attribute of the S object


getIOIn

public final com.hartmath.expression.HSymbol getIOIn(java.lang.Integer num)
Gets the iOIn attribute of the S object


getIOOut

public final java.lang.Short getIOOut(java.lang.String str)
Gets the iOOut attribute of the S object


getSymbolData

public final com.hartmath.expression.HSymbolData getSymbolData(com.hartmath.expression.HSymbol sym)
Gets the symbolData attribute of the S object


getLocalVarValue

public final com.hartmath.expression.HObject getLocalVarValue(com.hartmath.expression.HSymbol sym)
Gets the localVarValue attribute of the S object


getLocalPatternValue

public final com.hartmath.expression.HObject getLocalPatternValue(com.hartmath.expression.HSymbol sym)
Gets the localPatternValue attribute of the S object


getTraceEval

public boolean getTraceEval()
Gets the traceEval attribute of the S object


getTraceList

public com.hartmath.expression.HFunction getTraceList()
Gets the traceList attribute of the S object


resetTraceList

public void resetTraceList()
Resets the traceList attribute of the S object


recursionExceeded

public final boolean recursionExceeded()
Description of the Method


iterationExceeded

public final boolean iterationExceeded()
Description of the Method


incRecursionCounter

public final void incRecursionCounter()
Description of the Method


incIterationCounter

public final void incIterationCounter()
Description of the Method


decRecursionCounter

public final void decRecursionCounter()
Description of the Method


decIterationCounter

public final void decIterationCounter()
Description of the Method


addHistory

public final void addHistory()
Adds a feature to the History attribute of the S object


changeCurrentInHistory

public final void changeCurrentInHistory(com.hartmath.expression.HObject obj)
Description of the Method


changeCurrentOutHistory

public final void changeCurrentOutHistory(com.hartmath.expression.HObject obj)
Description of the Method


appendResultOut

public final void appendResultOut(java.lang.String str)
Description of the Method


appendLineResultOut

public final void appendLineResultOut(java.lang.String str)
Description of the Method


appendErrorOut

public final void appendErrorOut(java.lang.String str)
Description of the Method


appendLineErrorOut

public final void appendLineErrorOut(java.lang.String str)
Description of the Method


flushBuffers

public final void flushBuffers()
Description of the Method


incIOCounter

public final void incIOCounter()
Description of the Method


clearIOIn

public final void clearIOIn()
Description of the Method


clearIOOut

public final void clearIOOut()
Description of the Method


putIOIn

public final void putIOIn(java.lang.Integer num,
                          com.hartmath.expression.HSymbol obj)
Description of the Method


putIOOut

public final void putIOOut(java.lang.String str,
                           java.lang.Short num)
Description of the Method


addSymbolData

public final com.hartmath.expression.HSymbol addSymbolData(com.hartmath.expression.HSymbol sym)
Adds a symbol to the SymbolData attribute of the S object


addSymbolData

public final com.hartmath.expression.HSymbol addSymbolData(com.hartmath.expression.HSymbol sym,
                                                           int attributes)
Adds a feature to the SymbolData attribute of the S object


hasNoLocalVar

public final boolean hasNoLocalVar(com.hartmath.expression.HSymbol sym)
Description of the Method


createLocalVar

public final void createLocalVar(com.hartmath.expression.HSymbol sym,
                                 com.hartmath.expression.HObject obj)
Description of the Method


deleteLocalVar

public final com.hartmath.expression.HObject deleteLocalVar(com.hartmath.expression.HSymbol sym)
Description of the Method


hasNoLocalPattern

public final boolean hasNoLocalPattern(com.hartmath.expression.HSymbol sym)
Description of the Method


createLocalPattern

public final void createLocalPattern(com.hartmath.expression.HSymbol sym,
                                     com.hartmath.expression.HObject obj)
Description of the Method


deleteLocalPattern

public final com.hartmath.expression.HObject deleteLocalPattern(com.hartmath.expression.HSymbol sym)
Description of the Method


ELoop

public com.hartmath.expression.HObject ELoop(com.hartmath.expression.HObject obj)
Description of the Method


EV

public final com.hartmath.expression.HObject EV(com.hartmath.expression.HObject obj)
Symbolic evaluation


NEV

public final com.hartmath.expression.HObject NEV(com.hartmath.expression.HObject obj)
Numerical evaluation [sets numericFlag=true]


interpreter

public java.lang.String interpreter(java.lang.String expr)

interpreter

public java.lang.String interpreter(java.lang.String expr,
                                    boolean quietMode)

interpreter

public java.lang.String interpreter(java.lang.String expr,
                                    com.hartmath.expression.HFunction conv,
                                    boolean quietMode)

objectInterpreter

public com.hartmath.expression.HObject objectInterpreter(java.lang.String expression,
                                                         boolean convertResult,
                                                         boolean quietMode)
evaluate the expression


objectInterpreter

public com.hartmath.expression.HObject objectInterpreter(java.lang.String expression,
                                                         com.hartmath.expression.HFunction conversionFunction,
                                                         boolean convertResult,
                                                         boolean quietMode)
evaluate the expression


objectInterpreter

public com.hartmath.expression.HObject objectInterpreter(java.lang.String expr,
                                                         com.hartmath.expression.HFunction conv,
                                                         boolean rethrowError,
                                                         boolean convertResult,
                                                         boolean quietMode)
evaluate the expression