tcl.lang.channel
Class FileEventScript

java.lang.Object
  extended by tcl.lang.channel.FileEventScript
All Implemented Interfaces:
AssocData

public class FileEventScript
extends Object
implements AssocData

AssocData structure that keeps the script for one fileevent command. The existence of a FileEventScript object indicates the existence of a particular 'fileevent' command instance. Once the 'fileevent' command is called to delete the script, or if the interpreter is destroyed, the associated FileEventScript is disposed which signals FileEvents associated with this script to discontinue.


Method Summary
static void dispose(Interp interp, Channel channel, int type)
          Remove a FileEventScript, and hence all FileEvents, if it exists
 void disposeAssocData(Interp interp)
          This method is called when the interpreter is destroyed or when Interp.deleteAssocData is called on a registered AssocData instance.
static FileEventScript find(Interp interp, Channel channel, int type)
          Find a FileEventScript if it exists
 TclObject getScript()
           
static void register(Interp interp, Channel channel, int type, TclObject script)
          Create a FileEventScript, and register it in the interpreter, and queue the first FileEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

register

public static void register(Interp interp,
                            Channel channel,
                            int type,
                            TclObject script)
Create a FileEventScript, and register it in the interpreter, and queue the first FileEvent

Parameters:
interp - Interpreter for the fileevent
channel - name of channel that the fileEvent is registered on
type - either FileEvent.READABLE or FileEvent.WRITEABLE
script - script to register

getScript

public TclObject getScript()
Returns:
the script associated with this FileEventScript

disposeAssocData

public void disposeAssocData(Interp interp)
Description copied from interface: AssocData
This method is called when the interpreter is destroyed or when Interp.deleteAssocData is called on a registered AssocData instance.

Specified by:
disposeAssocData in interface AssocData
Parameters:
interp - the interpreter in which this AssocData instance is registered in

find

public static FileEventScript find(Interp interp,
                                   Channel channel,
                                   int type)
Find a FileEventScript if it exists

Parameters:
interp - Interpreter to search for the fileevent
channel - name of channel that the fileEvent is registered on
type - either FileEvent.READABLE or FileEvent.WRITEABLE
Returns:
FileEvent object, or null if it does not exist

dispose

public static void dispose(Interp interp,
                           Channel channel,
                           int type)
Remove a FileEventScript, and hence all FileEvents, if it exists

Parameters:
interp - Interpreter to search for the fileevent
channel - name of channel that the fileEvent is registered on
type - either FileEvent.READABLE or FileEvent.WRITEABLE


Copyright © 2015. All rights reserved.