|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectvmm.functions.EvalStack
public final class EvalStack
An object of type EvalStack is used in the evaluation of an expression or function
(as defined, for example, in the classes Expression, Function,
and ComplexFunction). The value() methods in such expressions
and fuctions can, optionally, take a parameter of type EvalStack. In fact, the
only thing that you can do with an EvalStack, outside of the package vmm.functions,
is construct it and pass it as a parameter to one of these value()
methods; the only reason to do this is to evaluate functions and expressions in
a thread-safe way.
| Constructor Summary | |
|---|---|
EvalStack()
Create an EvalStack with an initial size of 30. |
|
EvalStack(int initialSize)
Create an EvalStack with a specified initial size. |
|
| Method Summary | |
|---|---|
static EvalStack |
perThread()
Returns an EvalStack that is unique to the current thread. |
static EvalStack |
perThread(java.lang.Thread thread)
The first time this method is called by a given thread, it creates and returns a new EvalStack; subsequent calls with return the same EvalStack rather than create a new one. |
static void |
perThreadRelease(java.lang.Thread thread)
Discard the EvalStack, if any, that has been created for the specified thread by perThread() or perThread(Thread). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EvalStack()
public EvalStack(int initialSize)
initialSize - the initial size of the stack. If a size less than 1 is specified,
then the initial size will be 1.| Method Detail |
|---|
public static final EvalStack perThread()
perThread(Thread), with Thread.currentThread()
as its parameter.
public static final EvalStack perThread(java.lang.Thread thread)
Expression.value(), Function.value(double[])
and ComplexFunction.value(Complex[]). The method perThreadRelease(Thread)
can be called to discard the EvalStack that has been created for a given thread.
thread - the Thread whose associated EvalStack is to be returned. If thread is null,
the return value is also null.public static void perThreadRelease(java.lang.Thread thread)
perThread() or perThread(Thread).
thread - The thread whose EvalStack is to be discarded. If the value is
null or if there is not EvalStack for the specified stack, nothing is done;
this is not an error.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||