Java Doc for Context.java in  » Scripting » Pnuts » pnuts » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » Pnuts » pnuts.lang 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   pnuts.lang.Context

All known Subclasses:   pnuts.compiler.TranslateContext,  pnuts.tools.CancelableContext,  pnuts.compiler.CompileContext,  pnuts.tools.DebugContext,
Context
public class Context implements Cloneable(Code)
Context represents an internal state of a particular script execution. A Context is created when start executing a script and passed around during the execution. A pnuts.lang.Context object contains the following information.
  1. Current Package (which Pnuts-package being used)
  2. Imported Java-package list
  3. Writer to which print() write data
  4. Writer to which error() write message
  5. ClassLoader
  6. Modules added with use() function.
  7. Units
  8. Environments (accessed by Context.get() and set())
  9. Stack frame (for the pure interpreter)
  10. Encoding
A clone is created when eval(), load(), or loadFile() is called in a script. When a clone is created, (1) and (2) of the clone are reset to the default value.


Field Summary
 BinaryOperator_add
    
 UnaryOperator_add1
    
 BinaryOperator_and
    
 BinaryOperator_divide
    
 BooleanOperator_eq
    
 BooleanOperator_ge
    
 BooleanOperator_gt
    
 BooleanOperator_le
    
 BooleanOperator_lt
    
 BinaryOperator_mod
    
 BinaryOperator_multiply
    
 UnaryOperator_negate
    
 UnaryOperator_not
    
 BinaryOperator_or
    
 BinaryOperator_shiftArithmetic
    
 BinaryOperator_shiftLeft
    
 BinaryOperator_shiftRight
    
 BinaryOperator_subtract
    
 UnaryOperator_subtract1
    
 BinaryOperator_xor
    
protected  intbeginColumn
    
protected  intbeginLine
    
 ClassLoaderclassLoader
    
 ClassLoadercodeLoader
    
 Configurationconfig
    
 PackagecurrentPackage
    
static  ConfigurationdefaultConfig
    
final public static  PrintWriterdefaultErrorStream
    
final public static  PrintWriterdefaultOutputStream
    
final public static  PrintWriterdefaultTerminalStream
    
static  booleandefaultVerboseMode
    
protected  intdepth
    
 Stringencoding
    
protected  intendLine
    
protected  SymbolTableenvironment
    
 booleaneval
    
 CellevalFrameStack
    
static  StringexceptionHandlerTableSymbol
    
 ExecutableexitHook
    
static  StringfinallyFunctionSymbol
    
 Functionframe
    
static  SymbolTableglobals
    
protected  ImportEnvimportEnv
    
 booleaninGeneratorClosure
    
protected  CellloadingResource
    
 ModuleListlocalModuleList
    
protected  ModuleListmoduleList
    
 booleannamespaceRefreshed
    
 Contextparent
    
 ImplementationpnutsImpl
    
static  MapprimitiveTypes
    
protected  SymbolTableprovideTable
    
 PackagerootPackage
    
 Runtimeruntime
    
 StackFramestackFrame
    
protected  HashtableunitTable
    
 booleanverbose
    

Constructor Summary
public  Context()
    
public  Context(String pkg)
     Creates a context.
public  Context(Package pkg)
     Creates a context.
Parameters:
  pkg - the initial package of the context.
public  Context(Context context)
    
public  Context(Properties properties)
    

Method Summary
 Object_getId(String symbol)
    
 voidaddClassToImport(String className)
    
 voidaddPackageToImport(String pkgName)
    
 voidaddStaticMembers(String name, boolean wildcard)
    
public  voidautoload(String name, String file)
     Registers an autoload script for the name.
public  voidautoload(String name, AutoloadHook hook)
     Registers an AutoloadHook for the name in the current package.
final  voidbind(String symbol, Object obj)
    
 voidcatchException(Class t, PnutsFunction f)
    
public synchronized  voidclearPackages()
    
public  Objectclone()
    
public  Objectclone(boolean clear_attributes, boolean clear_locals)
    
protected  voidclose(Function func, Object args)
    
 voidcloseLocal()
    
public  booleandefined(String name)
     Checks if the name is defined in the context.
public  Objectget(String symbol)
     Gets an environemnt variable associated with this context.
Parameters:
  symbol - the name of the variable, which must be intern'ed.
public  ClassLoadergetClassLoader()
     Gets the current class loader.
public  ClassLoadergetCodeLoader()
     Gets the current class loader for class geneartion The initial value is null.
public  ConfigurationgetConfiguration()
    
public  PackagegetCurrentPackage()
    
public  PrintWritergetErrorStream()
    
public  PrintWritergetErrorWriter()
    
public  ExecutablegetExitHook()
    
public  ObjectgetId(String interned)
     Gets the value of a symbol.
public  ImplementationgetImplementation()
    
public  StringgetName()
    
public  OutputStreamgetOutputStream()
     Get the standard output stream of the context, to which write() writes data.
public  PnutsImplgetPnutsImpl()
    
public  StringgetScriptEncoding()
    
protected  ObjectgetScriptSource()
     Get the source of the script.
public  PrintWritergetTerminalStream()
    
public  PrintWritergetTerminalWriter()
    
protected  ObjectgetValue(String symbol)
    
public  PrintWritergetWriter()
     Get the standard writer of the context, to which print()/println() write messages.
public  booleanisVerbose()
    
public  Enumerationkeys()
     Returns an enumeration of the keys in the environment of this context.
 longlastModified(String file)
    
protected  voidloadModule(String name, Package pkg)
     Loads a module is it has not been loaded yet. The initialization script is: 1) Replace :: and .
synchronized  ModuleListlocalModuleList()
    
protected  voidonError(Throwable t)
     This method is called when an exception is thrown.
protected  voidonExit(Object arg)
     This method is called when the excecution is terminated normally.
protected  voidopen(Function f, Object args)
    
 voidopenLocal(String locals)
    
synchronized  voidpopFile()
    
 voidprovide(String file)
    
synchronized  voidpushFile(Object file)
    
public  voidregisterQuantityFactory(String unit, QuantityFactory fac)
     Defines a unit.
 voidrequire(String file, boolean checkForUpdate)
     Loads a script file only if it has not been loaded.
 voidresetImportEnv()
    
 voidresetStackFrame()
    
public  ClassresolveClass(String symbol)
    
public  ObjectresolveSymbol(String interned)
    
 voidrevoke(String file)
    
public  voidset(String symbol, Object value)
     Defines an environemnt variable associated with this context To access those environment variables, Context.get(String) should be called.
public  voidsetClassLoader(ClassLoader loader)
     Changes the current class loader for this context.
public  voidsetCodeLoader(ClassLoader loader)
     Sets the current class loader for class geneartion Expressions that generate class create a classloader to load generated classes based on the current class loader.
public  voidsetConfiguration(Configuration config)
     Changes the configuration for this context.
public  voidsetCurrentPackage(Package pkg)
    
public  voidsetErrorStream(Object errorStream, boolean autoFlush)
     Set an OutputStream or a Writer to which error() write messages If errorStream is null, exception is thrown out of eval loop.
public  voidsetErrorStream(Object errorStream)
    
public  voidsetErrorWriter(Writer w, boolean autoFlush)
    
public  voidsetErrorWriter(Writer w)
    
public  voidsetExitHook(Executable hook)
     Sets a hook to be executed at the end of a script.
 voidsetFinallyFunction(PnutsFunction func)
    
public  voidsetImplementation(Implementation impl)
     Changes the Implementation object associated with this context
Parameters:
  impl - The Implementation object, which defines the implementation ofthe interpreter.
public  voidsetName(String name)
    
public  voidsetOutputStream(Object out, boolean autoFlush)
    
public  voidsetOutputStream(Object outputStream)
    
public  voidsetOutputStream(OutputStream out)
     Set the specified OutputStream as the standard output stream of the context, to which write() writes data.
public  voidsetPnutsImpl(PnutsImpl impl)
     Changes the PnutsImpl object associated with this context
Parameters:
  impl - The PnutsImpl object, which defines the implementation of theinterpreter.
public  voidsetScriptEncoding(String encoding)
    
public  voidsetTerminalStream(Object str, boolean autoFlush)
     Set the terminal stream of the context, in which the prompt is shown.
public  voidsetTerminalStream(Object stream)
    
public  voidsetTerminalWriter(Writer w)
    
public  voidsetTerminalWriter(Writer w, boolean autoFlush)
    
protected  voidsetValue(String symbol, Object obj)
    
public  voidsetVerbose(boolean b)
    
public  voidsetWriter(Writer out)
     Set the specified Writer as the standard writer of the context. PrintWriter is created from the specified Writer if the Writer is not an instance of PrintWriter.
public  voidsetWriter(Writer out, boolean autoFlush)
     Set the specified Writer as the standard writer of the context. PrintWriter is created from the specified Writer if the Writer is not an instance of PrintWriter.
 Objectundefined(String sym)
    
public synchronized  booleanunusePackage(Package pkg)
    
protected  voidupdateColumn(int column)
    
 voidupdateLine(SimpleNode node)
    
protected  voidupdateLine(SimpleNode node, int beginLine, int beginColumn)
     AST interpreter calls this method when line number changes, giving AST nodes and line information Not that compiler does not call this method.
protected  voidupdateLine(int line)
     Both AST interpreter and compiler call this method when line number changes. Subclasses may override this method to interact with running script.
public  booleanusePackage(Package pkg, boolean checkException)
    
public  booleanusePackage(String name)
     Add a package to the use()'d package list.
public  booleanusePackage(String name, boolean checkException)
     Add a package to the use()'d package list.
public  String[]usedPackages()
    

Field Detail
_add
BinaryOperator _add(Code)



_add1
UnaryOperator _add1(Code)



_and
BinaryOperator _and(Code)



_divide
BinaryOperator _divide(Code)



_eq
BooleanOperator _eq(Code)



_ge
BooleanOperator _ge(Code)



_gt
BooleanOperator _gt(Code)



_le
BooleanOperator _le(Code)



_lt
BooleanOperator _lt(Code)



_mod
BinaryOperator _mod(Code)



_multiply
BinaryOperator _multiply(Code)



_negate
UnaryOperator _negate(Code)



_not
UnaryOperator _not(Code)



_or
BinaryOperator _or(Code)



_shiftArithmetic
BinaryOperator _shiftArithmetic(Code)



_shiftLeft
BinaryOperator _shiftLeft(Code)



_shiftRight
BinaryOperator _shiftRight(Code)



_subtract
BinaryOperator _subtract(Code)



_subtract1
UnaryOperator _subtract1(Code)



_xor
BinaryOperator _xor(Code)



beginColumn
protected int beginColumn(Code)



beginLine
protected int beginLine(Code)



classLoader
ClassLoader classLoader(Code)



codeLoader
ClassLoader codeLoader(Code)



config
Configuration config(Code)



currentPackage
Package currentPackage(Code)



defaultConfig
static Configuration defaultConfig(Code)



defaultErrorStream
final public static PrintWriter defaultErrorStream(Code)



defaultOutputStream
final public static PrintWriter defaultOutputStream(Code)



defaultTerminalStream
final public static PrintWriter defaultTerminalStream(Code)



defaultVerboseMode
static boolean defaultVerboseMode(Code)



depth
protected int depth(Code)



encoding
String encoding(Code)



endLine
protected int endLine(Code)



environment
protected SymbolTable environment(Code)



eval
boolean eval(Code)



evalFrameStack
Cell evalFrameStack(Code)



exceptionHandlerTableSymbol
static String exceptionHandlerTableSymbol(Code)



exitHook
Executable exitHook(Code)



finallyFunctionSymbol
static String finallyFunctionSymbol(Code)



frame
Function frame(Code)



globals
static SymbolTable globals(Code)



importEnv
protected ImportEnv importEnv(Code)



inGeneratorClosure
boolean inGeneratorClosure(Code)



loadingResource
protected Cell loadingResource(Code)



localModuleList
ModuleList localModuleList(Code)



moduleList
protected ModuleList moduleList(Code)



namespaceRefreshed
boolean namespaceRefreshed(Code)



parent
Context parent(Code)



pnutsImpl
Implementation pnutsImpl(Code)



primitiveTypes
static Map primitiveTypes(Code)



provideTable
protected SymbolTable provideTable(Code)



rootPackage
Package rootPackage(Code)



runtime
Runtime runtime(Code)



stackFrame
StackFrame stackFrame(Code)



unitTable
protected Hashtable unitTable(Code)



verbose
boolean verbose(Code)




Constructor Detail
Context
public Context()(Code)
Create a new context



Context
public Context(String pkg)(Code)
Creates a context.
Parameters:
  pkg - the name of the package.



Context
public Context(Package pkg)(Code)
Creates a context.
Parameters:
  pkg - the initial package of the context. If null, the globalpackage is used.



Context
public Context(Context context)(Code)
Creates a context from a template
Parameters:
  context - The template
since:
   1.0beta9



Context
public Context(Properties properties)(Code)




Method Detail
_getId
Object _getId(String symbol)(Code)



addClassToImport
void addClassToImport(String className)(Code)



addPackageToImport
void addPackageToImport(String pkgName)(Code)



addStaticMembers
void addStaticMembers(String name, boolean wildcard)(Code)



autoload
public void autoload(String name, String file)(Code)
Registers an autoload script for the name. If name is not defined when accessed, the registerred file is loaded.
Parameters:
  name - variable name
Parameters:
  file - the file



autoload
public void autoload(String name, AutoloadHook hook)(Code)
Registers an AutoloadHook for the name in the current package.
Parameters:
  name - variable name
Parameters:
  hook - the AutoloadHook



bind
final void bind(String symbol, Object obj)(Code)



catchException
void catchException(Class t, PnutsFunction f)(Code)



clearPackages
public synchronized void clearPackages()(Code)
Unregisteres all use()'d packages



clone
public Object clone()(Code)
Make a clone of the context



clone
public Object clone(boolean clear_attributes, boolean clear_locals)(Code)
Make a clone of the context
Parameters:
  clear_attributes - If true, import() state and current package are reset to thedefault values.
Parameters:
  clear_locals - If true, local stack is reset.



close
protected void close(Function func, Object args)(Code)



closeLocal
void closeLocal()(Code)



defined
public boolean defined(String name)(Code)
Checks if the name is defined in the context.



get
public Object get(String symbol)(Code)
Gets an environemnt variable associated with this context.
Parameters:
  symbol - the name of the variable, which must be intern'ed. the value of the variable



getClassLoader
public ClassLoader getClassLoader()(Code)
Gets the current class loader. The initial value is set to Thread.currentThread().getContextClassLoader() when the instance is created. the class loader



getCodeLoader
public ClassLoader getCodeLoader()(Code)
Gets the current class loader for class geneartion The initial value is null. Expressions that generate class create a classloader to load generated classes based on the current class loader. the class loader



getConfiguration
public Configuration getConfiguration()(Code)



getCurrentPackage
public Package getCurrentPackage()(Code)
get the current package



getErrorStream
public PrintWriter getErrorStream()(Code)
Get an OutputStream or a Writer to which error() write messages



getErrorWriter
public PrintWriter getErrorWriter()(Code)
Get an PrintWriter to which error() write messages



getExitHook
public Executable getExitHook()(Code)
Gets the hook to be executed at the end of a script



getId
public Object getId(String interned)(Code)
Gets the value of a symbol.
Parameters:
  interned - a symbol (interned string) the value of the symbol
exception:
  PnutsException - if the specified symbol is not defined



getImplementation
public Implementation getImplementation()(Code)
Gets the Implementation object associated with this context



getName
public String getName()(Code)
Gets the name of the context The name of the context.



getOutputStream
public OutputStream getOutputStream()(Code)
Get the standard output stream of the context, to which write() writes data. This method returns the OutputStream previously set by setOutputStream(). If setWriter() has been called, getOutputStream() returns null. the standard output stream of the context



getPnutsImpl
public PnutsImpl getPnutsImpl()(Code)
Gets the PnutsImpl object associated with this context



getScriptEncoding
public String getScriptEncoding()(Code)
Gets the current script encoding the current script encoding



getScriptSource
protected Object getScriptSource()(Code)
Get the source of the script.
java.net.URL object, when the script is not precompiledpnuts.lang.Runtime object, when the script is precompiled



getTerminalStream
public PrintWriter getTerminalStream()(Code)
get terminal-output-stream of the context



getTerminalWriter
public PrintWriter getTerminalWriter()(Code)
get terminal-output-stream of the context



getValue
protected Object getValue(String symbol)(Code)



getWriter
public PrintWriter getWriter()(Code)
Get the standard writer of the context, to which print()/println() write messages. the standard writer of the context



isVerbose
public boolean isVerbose()(Code)
Check the current verbose mode the current verbose mode



keys
public Enumeration keys()(Code)
Returns an enumeration of the keys in the environment of this context.



lastModified
long lastModified(String file)(Code)



loadModule
protected void loadModule(String name, Package pkg) throws IOException(Code)
Loads a module is it has not been loaded yet. The initialization script is: 1) Replace :: and . with / then append "/init", e.g. pnuts.lib => pnuts/lib/init 2) The 1st line in META-INF/pnuts/module/
Parameters:
  name - the name of the module
Parameters:
  pkg - the associated package (name space)
exception:
  FileNotFoundException - thrown when the initialization script is not found.



localModuleList
synchronized ModuleList localModuleList()(Code)



onError
protected void onError(Throwable t)(Code)
This method is called when an exception is thrown.



onExit
protected void onExit(Object arg)(Code)
This method is called when the excecution is terminated normally.



open
protected void open(Function f, Object args)(Code)



openLocal
void openLocal(String locals)(Code)



popFile
synchronized void popFile()(Code)



provide
void provide(String file)(Code)



pushFile
synchronized void pushFile(Object file)(Code)



registerQuantityFactory
public void registerQuantityFactory(String unit, QuantityFactory fac)(Code)
Defines a unit.
Parameters:
  unit - The unit symbol
Parameters:
  fac - A QuantityFactory object which defines what kind of object iscreated when a decimal number with this unit symbol isevaluated.



require
void require(String file, boolean checkForUpdate) throws FileNotFoundException(Code)
Loads a script file only if it has not been loaded. It is guaranteed that the script runs at most once in this context.
Parameters:
  file - the script file, which must be an intern'ed String.



resetImportEnv
void resetImportEnv()(Code)



resetStackFrame
void resetStackFrame()(Code)



resolveClass
public Class resolveClass(String symbol)(Code)



resolveSymbol
public Object resolveSymbol(String interned)(Code)
Resolves the value of a symbol in the following order: (1) current package (2) builtin functions, primitive types, pnuts_version (3) module exports (4) imported classes (5) parent packages
Parameters:
  interned - a symbol (interned string) the value of the symbol, or null if it is not defined.



revoke
void revoke(String file)(Code)



set
public void set(String symbol, Object value)(Code)
Defines an environemnt variable associated with this context To access those environment variables, Context.get(String) should be called. Note that those variables can not be accessed just by specifying their names in Pnuts interpreter. Since the environment varariables are bound to the executing context, they are accessible from various modules that the script uses. Therefore, the name of environment variables should have prefixes so that name conflict is unlikely to occur. The name that starts with "pnuts." is reserved.
Parameters:
  symbol - the name of the variable, which must be intern'ed.
Parameters:
  value - the value of the variable
since:
   1.0beta8



setClassLoader
public void setClassLoader(ClassLoader loader)(Code)
Changes the current class loader for this context. The initial value is set to Thread.currentThread().getContextClassLoader() when the instance is created.
Parameters:
  loader - the class loader



setCodeLoader
public void setCodeLoader(ClassLoader loader)(Code)
Sets the current class loader for class geneartion Expressions that generate class create a classloader to load generated classes based on the current class loader.
Parameters:
  loader - the class loader



setConfiguration
public void setConfiguration(Configuration config)(Code)
Changes the configuration for this context.
Parameters:
  config - the configuration



setCurrentPackage
public void setCurrentPackage(Package pkg)(Code)
set the current package



setErrorStream
public void setErrorStream(Object errorStream, boolean autoFlush)(Code)
Set an OutputStream or a Writer to which error() write messages If errorStream is null, exception is thrown out of eval loop.



setErrorStream
public void setErrorStream(Object errorStream)(Code)
Set ar PrintWriter to which error() write messages



setErrorWriter
public void setErrorWriter(Writer w, boolean autoFlush)(Code)



setErrorWriter
public void setErrorWriter(Writer w)(Code)



setExitHook
public void setExitHook(Executable hook)(Code)
Sets a hook to be executed at the end of a script. The default value is null.
Parameters:
  hook - the hook



setFinallyFunction
void setFinallyFunction(PnutsFunction func)(Code)



setImplementation
public void setImplementation(Implementation impl)(Code)
Changes the Implementation object associated with this context
Parameters:
  impl - The Implementation object, which defines the implementation ofthe interpreter. eval(), load(), and loadFile() ofpnuts.lang.Pnuts select an implementation (pure interpreter,on-the-fly compiler, etc.), according to the context passed tothe methods.



setName
public void setName(String name)(Code)
Sets the name of the context
Parameters:
  name - The name of the context.



setOutputStream
public void setOutputStream(Object out, boolean autoFlush)(Code)
set output stream of the context



setOutputStream
public void setOutputStream(Object outputStream)(Code)
set output stream of the context



setOutputStream
public void setOutputStream(OutputStream out)(Code)
Set the specified OutputStream as the standard output stream of the context, to which write() writes data. A PrintWriter is created from the specified OutputStream, which is returned by getWriter(). If null is specified, both getOutputStream() and getWriter() return null.
Parameters:
  out - the OutputStream



setPnutsImpl
public void setPnutsImpl(PnutsImpl impl)(Code)
Changes the PnutsImpl object associated with this context
Parameters:
  impl - The PnutsImpl object, which defines the implementation of theinterpreter. eval(), load(), and loadFile() ofpnuts.lang.Pnuts select an implementation (pure interpreter,on-the-fly compiler, etc.), according to the context passed tothe methods.



setScriptEncoding
public void setScriptEncoding(String encoding)(Code)
Changes the script encoding for the context
Parameters:
  encoding - the encoding



setTerminalStream
public void setTerminalStream(Object str, boolean autoFlush)(Code)
Set the terminal stream of the context, in which the prompt is shown.



setTerminalStream
public void setTerminalStream(Object stream)(Code)
Set the terminal stream of the context



setTerminalWriter
public void setTerminalWriter(Writer w)(Code)
Set the terminal writer of the context
Parameters:
  w - the Writer



setTerminalWriter
public void setTerminalWriter(Writer w, boolean autoFlush)(Code)
Set the terminal writer of the context
Parameters:
  w - the Writer



setValue
protected void setValue(String symbol, Object obj)(Code)



setVerbose
public void setVerbose(boolean b)(Code)
Sets the verbose mode



setWriter
public void setWriter(Writer out)(Code)
Set the specified Writer as the standard writer of the context. PrintWriter is created from the specified Writer if the Writer is not an instance of PrintWriter. If this method has been called, getOutputStream() returns null. If null is specifed to this method, both getWriter() and getOutputStream() return null.
Parameters:
  out - the Writer



setWriter
public void setWriter(Writer out, boolean autoFlush)(Code)
Set the specified Writer as the standard writer of the context. PrintWriter is created from the specified Writer if the Writer is not an instance of PrintWriter. If this method has been called, getOutputStream() returns null. If null is specifed to this method, both getWriter() and getOutputStream() return null.
Parameters:
  out - the Writer
Parameters:
  autoFlush - A boolean; if true, the PrintWriter.println() methods willflush the output buffer



undefined
Object undefined(String sym)(Code)



unusePackage
public synchronized boolean unusePackage(Package pkg)(Code)



updateColumn
protected void updateColumn(int column)(Code)



updateLine
void updateLine(SimpleNode node)(Code)



updateLine
protected void updateLine(SimpleNode node, int beginLine, int beginColumn)(Code)
AST interpreter calls this method when line number changes, giving AST nodes and line information Not that compiler does not call this method.
Parameters:
  node - the current AST node
Parameters:
  beginLine - the line number at which the current expression starts.
Parameters:
  beginColumn - the column number at which theh current expression ends.



updateLine
protected void updateLine(int line)(Code)
Both AST interpreter and compiler call this method when line number changes. Subclasses may override this method to interact with running script. For example, a subclass may redefine this method so that it can stop the execution if Thread.interrupt() has been called.
Parameters:
  line - the line number



usePackage
public boolean usePackage(Package pkg, boolean checkException)(Code)



usePackage
public boolean usePackage(String name)(Code)
Add a package to the use()'d package list.
Parameters:
  name - the package name true if successfully use()'d.



usePackage
public boolean usePackage(String name, boolean checkException)(Code)
Add a package to the use()'d package list.
Parameters:
  name - the package name
Parameters:
  checkException - if false exceptions are ignored true if successfully use()'d.



usedPackages
public String[] usedPackages()(Code)
Returns the list of use()'d packages



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.