Class nist.feather.TclInterpreter
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class nist.feather.TclInterpreter

Object
   |
   +----nist.feather.TclInterpreter

public class TclInterpreter
extends Object
This class serves as a proxy class for a Tcl interpreter. A new Tcl interpreter is created when a TclInterpreter object is instantiated. The interpreter maintains its state between calls to its methods. The Tcl interpreter is destroyed when its TclInterpreter object is finalized.

Version:
0.1
Author:
Alden Dima

Constructor Index

 o nist.feather.TclInterpreter()
Creates a new TclInterpreter proxy object with its corresponding Tcl interpreter.

Method Index

 o eval(String)
Causes the Tcl interpreter to evaluate a Java string as a script and returns the result as a Java string.
 o evalFile(File)
Causes the Tcl interpreter to evaluate a file as a script and returns the result as a Java string.
 o finalize()
Destroys the native Tcl interpreter.

Constructors

 o TclInterpreter
public TclInterpreter()
Creates a new TclInterpreter proxy object with its corresponding Tcl interpreter.

Methods

 o eval
public java.lang.String eval(String script) throws TclEvalException
Causes the Tcl interpreter to evaluate a Java string as a script and returns the result as a Java string. Can be used to call individual Tcl procs (either builtin commands or those that have been previously loaded using evalFile).

Parameters:
script - The Java string to be evaluated as a Tcl script. The script length cannot exceed 64 KB or a TclEvalException will be thrown.
Returns:
A Java string containing the result of the script evaluation. The result string length cannot exceed 64 KB or a TclEvalException will be thrown.
Throws: TclEvalException
 o evalFile
public java.lang.String evalFile(File script) throws TclEvalException
Causes the Tcl interpreter to evaluate a file as a script and returns the result as a Java string. Useful as a means to "source" a script so that its procs can be called by eval.

Parameters:
script - The Java file object that represents a Tcl script.
Returns:
A Java string containing the result of the script evaluation. The result string length cannot exceed 64 KB or a TclEvalException will be thrown.
Throws: TclEvalException
 o finalize
protected void finalize()
Destroys the native Tcl interpreter.

Overrides:
finalize in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index