All Packages Class Hierarchy This Package Previous Next Index
Class pnuts.lang.Context
pnuts.lang.Context
- public class Context
- implements Property
Context represents an internal state in Pnuts runtime environment.
A Context object contains
the following information.
- Stack frame
- Which Pnuts-package being used
- Imported Java-package list
- Writer to which print() write data
- Writer to which error() write message
Note that the name space is shared by all contexts.
-
Context()
- Create a new context
-
Context(Package)
- Creates a context.
-
Context(String)
- Creates a context.
-
clone()
- Make a clone of the context
-
defined(String)
-
-
get(String)
-
-
getCurrentPackage()
- get the current package
-
getErrorStream()
- get error-output-stream of the context
-
getOutputStream()
- get output stream of the context
-
getTerminalStream()
- get terminal-output-stream of the context
-
set(String, Object)
-
-
setErrorStream(OutputStream)
-
-
setErrorStream(OutputStream, boolean)
- set error-output-stream of the context
-
setErrorStream(Writer)
-
-
setErrorStream(Writer, boolean)
-
-
setOutputStream(OutputStream)
-
-
setOutputStream(OutputStream, boolean)
- set output stream of the context
-
setOutputStream(Writer)
-
-
setOutputStream(Writer, boolean)
-
-
setTerminalStream(OutputStream)
-
-
setTerminalStream(OutputStream, boolean)
- set terminal-output-stream of the context
-
setTerminalStream(Writer)
-
-
setTerminalStream(Writer, boolean)
-
Context
public Context()
- Create a new context
Context
public Context(String pkg)
- Creates a context.
- Parameters:
- pkg - the name of the package.
Context
public Context(Package pkg)
- Creates a context.
- Parameters:
- pkg - the initial package of the context.
clone
public Object clone()
- Make a clone of the context
setOutputStream
public void setOutputStream(OutputStream outputStream,
boolean autoFlush)
- set output stream of the context
setOutputStream
public void setOutputStream(OutputStream outputStream)
setOutputStream
public void setOutputStream(Writer outputWriter,
boolean autoFlush)
setOutputStream
public void setOutputStream(Writer outputWriter)
getOutputStream
public ConsoleOutputStream getOutputStream()
- get output stream of the context
setTerminalStream
public void setTerminalStream(OutputStream terminalStream,
boolean autoFlush)
- set terminal-output-stream of the context
setTerminalStream
public void setTerminalStream(OutputStream terminalStream)
setTerminalStream
public void setTerminalStream(Writer terminalWriter,
boolean autoFlush)
setTerminalStream
public void setTerminalStream(Writer terminalWriter)
getTerminalStream
public ConsoleOutputStream getTerminalStream()
- get terminal-output-stream of the context
setErrorStream
public void setErrorStream(OutputStream errorStream,
boolean autoFlush)
- set error-output-stream of the context
setErrorStream
public void setErrorStream(OutputStream errorStream)
setErrorStream
public void setErrorStream(Writer errorWriter,
boolean autoFlush)
setErrorStream
public void setErrorStream(Writer errorWriter)
getErrorStream
public ConsoleOutputStream getErrorStream()
- get error-output-stream of the context
getCurrentPackage
public Package getCurrentPackage()
- get the current package
set
public void set(String symbol,
Object obj)
get
public Object get(String symbol)
defined
public boolean defined(String symbol)
All Packages Class Hierarchy This Package Previous Next Index