tcl.lang
Class Namespace

java.lang.Object
  extended by tcl.lang.Namespace

public class Namespace
extends java.lang.Object


Nested Class Summary
static interface Namespace.DeleteProc
           
 
Field Summary
 int activationCount
           
 java.util.HashMap childTable
           
 java.util.HashMap cmdTable
           
static int CREATE_NS_IF_UNKNOWN
           
 Namespace.DeleteProc deleteProc
           
 java.lang.String[] exportArray
           
static int FIND_ONLY_NS
           
 int flags
           
 java.lang.String fullName
           
 Interp interp
           
 int maxExportPatterns
           
 java.lang.String name
           
 long nsId
           
 int numExportPatterns
           
 Namespace parent
           
 int refCount
           
 Resolver resolver
           
 java.util.HashMap varTable
           
 
Constructor Summary
Namespace()
           
 
Method Summary
static Namespace createNamespace(Interp interp, java.lang.String name, Namespace.DeleteProc deleteProc)
           
static void deleteNamespace(Namespace namespace)
           
static void exportList(Interp interp, Namespace namespace, java.lang.String pattern, boolean resetListFirst)
           
static WrappedCommand findCommand(Interp interp, java.lang.String name, Namespace contextNs, int flags)
           
static Namespace findNamespace(Interp interp, java.lang.String name, Namespace contextNs, int flags)
           
static Var findNamespaceVar(Interp interp, java.lang.String name, Namespace contextNs, int flags)
           
static Namespace getCurrentNamespace(Interp interp)
           
static Namespace getGlobalNamespace(Interp interp)
           
static WrappedCommand getOriginalCommand(WrappedCommand command)
           
static void importList(Interp interp, Namespace namespace, java.lang.String pattern, boolean allowOverwrite)
           
static void popCallFrame(Interp interp)
           
static void pushCallFrame(Interp interp, CallFrame frame, Namespace namespace, boolean isProcCallFrame)
           
static void setNamespaceResolver(Namespace namespace, Resolver resolver)
          ---------------------------------------------------------------------- Tcl_SetNamespaceResolvers -> setNamespaceResolver Sets the command/variable resolution object for a namespace, thereby changing the way that command/variable names are interpreted.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name

fullName

public java.lang.String fullName

deleteProc

public Namespace.DeleteProc deleteProc

parent

public Namespace parent

childTable

public java.util.HashMap childTable

nsId

public long nsId

interp

public Interp interp

flags

public int flags

activationCount

public int activationCount

refCount

public int refCount

cmdTable

public java.util.HashMap cmdTable

varTable

public java.util.HashMap varTable

exportArray

public java.lang.String[] exportArray

numExportPatterns

public int numExportPatterns

maxExportPatterns

public int maxExportPatterns

resolver

public Resolver resolver

FIND_ONLY_NS

public static final int FIND_ONLY_NS
See Also:
Constant Field Values

CREATE_NS_IF_UNKNOWN

public static final int CREATE_NS_IF_UNKNOWN
See Also:
Constant Field Values
Constructor Detail

Namespace

public Namespace()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getCurrentNamespace

public static Namespace getCurrentNamespace(Interp interp)

getGlobalNamespace

public static Namespace getGlobalNamespace(Interp interp)

pushCallFrame

public static void pushCallFrame(Interp interp,
                                 CallFrame frame,
                                 Namespace namespace,
                                 boolean isProcCallFrame)

popCallFrame

public static void popCallFrame(Interp interp)

createNamespace

public static Namespace createNamespace(Interp interp,
                                        java.lang.String name,
                                        Namespace.DeleteProc deleteProc)

deleteNamespace

public static void deleteNamespace(Namespace namespace)

exportList

public static void exportList(Interp interp,
                              Namespace namespace,
                              java.lang.String pattern,
                              boolean resetListFirst)
                       throws TclException
Throws:
TclException

importList

public static void importList(Interp interp,
                              Namespace namespace,
                              java.lang.String pattern,
                              boolean allowOverwrite)
                       throws TclException
Throws:
TclException

getOriginalCommand

public static WrappedCommand getOriginalCommand(WrappedCommand command)

findNamespace

public static Namespace findNamespace(Interp interp,
                                      java.lang.String name,
                                      Namespace contextNs,
                                      int flags)

findCommand

public static WrappedCommand findCommand(Interp interp,
                                         java.lang.String name,
                                         Namespace contextNs,
                                         int flags)
                                  throws TclException
Throws:
TclException

findNamespaceVar

public static Var findNamespaceVar(Interp interp,
                                   java.lang.String name,
                                   Namespace contextNs,
                                   int flags)
                            throws TclException
Throws:
TclException

setNamespaceResolver

public static void setNamespaceResolver(Namespace namespace,
                                        Resolver resolver)
---------------------------------------------------------------------- Tcl_SetNamespaceResolvers -> setNamespaceResolver Sets the command/variable resolution object for a namespace, thereby changing the way that command/variable names are interpreted. This allows extension writers to support different name resolution schemes, such as those for object-oriented packages. Command resolution is handled by the following method: resolveCmd (Interp interp, String name, Namespace context, int flags) throws TclException; Whenever a command is executed or Namespace.findCommand is invoked within the namespace, this method is called to resolve the command name. If this method is able to resolve the name, it should return the corresponding WrappedCommand. Otherwise, the procedure can return null, and the command will be treated under the usual name resolution rules. Or, it can throw a TclException, and the command will be considered invalid. Variable resolution is handled by the following method: resolveVar (Interp interp, String name, Namespace context, int flags) throws TclException; If this method is able to resolve the name, it should return the variable as Var object. The method may also return null, and the variable will be treated under the usual name resolution rules. Or, it can throw a TclException, and the variable will be considered invalid. Results: See above. Side effects: None. ----------------------------------------------------------------------