tcl.lang.channel
Class FileEvent

java.lang.Object
  extended by tcl.lang.TclEvent
      extended by tcl.lang.channel.FileEvent

public class FileEvent
extends TclEvent

This class is the handles the transient event that executes a 'fileevent' script exactly once. It schedules a duplicate of itself for the next fileevent script execution. It is closely tied with FileEventScript.

Author:
Dan Bodoh

Field Summary
static int READABLE
          Indicates a READ file event
static int WRITABLE
          Indicates a WRITE file event
 
Method Summary
static boolean isStdinUsedForCommandInput()
           
 int processEvent(int flags)
          Process the event.
static void queueFileEvent(Interp interp, Channel channel, int type)
          Create a new FileEvent and add it to the TclEvent queue.
static boolean setStdinUsedForCommandInput(boolean stdinUsedForCommandInput)
           
 
Methods inherited from class tcl.lang.TclEvent
sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READABLE

public static final int READABLE
Indicates a READ file event

See Also:
Constant Field Values

WRITABLE

public static final int WRITABLE
Indicates a WRITE file event

See Also:
Constant Field Values
Method Detail

queueFileEvent

public static void queueFileEvent(Interp interp,
                                  Channel channel,
                                  int type)
Create a new FileEvent and add it to the TclEvent queue.

Parameters:
interp - interpreter in which to create the file event
channel - Channel on which to create the file event
type - either READABLE or WRITABLE

processEvent

public int processEvent(int flags)
Description copied from class: TclEvent
Process the event. Override this method to implement new types of events. Note: this method is called by the primary thread of the notifier.

Specified by:
processEvent in class TclEvent
Parameters:
flags - Miscellaneous flag values: may be any combination of TCL.DONT_WAIT, TCL.WINDOW_EVENTS, TCL.FILE_EVENTS, TCL.TIMER_EVENTS, TCL.IDLE_EVENTS, or others defined by event sources - this is the same as the flags passed to Notifier.doOneEvent()
Returns:
1 means the event has been processed and can be removed from the event queue. 0 means the event should be deferred for processing later.

isStdinUsedForCommandInput

public static boolean isStdinUsedForCommandInput()
Returns:
true if stdin is currently being used for command input and file events should not be fired on stdin

setStdinUsedForCommandInput

public static boolean setStdinUsedForCommandInput(boolean stdinUsedForCommandInput)
Parameters:
stdinUsedForCommandInput - the stdinUsedForCommandInput to set
Returns:
previous value of flag


Copyright © 2015. All rights reserved.