tcl.lang
Class CommandTrace

java.lang.Object
  extended by tcl.lang.CommandTrace

public class CommandTrace
extends Object

This CommandTrace class is used to trace command rename and deletion


Field Summary
protected  String callbackCmd
          Command to call when trace is fired
static int DELETE
          Indicates a CommandTrace that will execute on a command deletion
static int RENAME
          Indicates a CommandTrace that will execute on a command rename
protected  int type
          The type of trace, either DELETE or RENAME
 
Constructor Summary
CommandTrace(Interp interp, int type, TclObject callbackCmd)
          Create a new CommandTrace
 
Method Summary
 String getCallbackCmd()
           
 int getType()
           
 void trace(Interp interp, int type, String oldname, String newname)
          Call the callback function for this CommandTrace if it matches type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELETE

public static final int DELETE
Indicates a CommandTrace that will execute on a command deletion

See Also:
Constant Field Values

RENAME

public static final int RENAME
Indicates a CommandTrace that will execute on a command rename

See Also:
Constant Field Values

callbackCmd

protected String callbackCmd
Command to call when trace is fired


type

protected int type
The type of trace, either DELETE or RENAME

Constructor Detail

CommandTrace

public CommandTrace(Interp interp,
                    int type,
                    TclObject callbackCmd)
Create a new CommandTrace

Parameters:
type - either DELETE or RENAME
callbackCmd - command to execute when fired
Method Detail

getType

public int getType()
Returns:
the type of this trace, either RENAME or DELETE

getCallbackCmd

public String getCallbackCmd()
Returns:
the callback command for this trace

trace

public void trace(Interp interp,
                  int type,
                  String oldname,
                  String newname)
Call the callback function for this CommandTrace if it matches type. Any errors in the callback function are ignored.

Parameters:
type - type of trace being executed (DELETE or RENAME)
oldname - old name of command being renamed or deleted
newname - new name of command being renamed; ignored for DELETE type


Copyright © 2015. All rights reserved.