ti.swing.console
Class LogInputHandler

java.lang.Object
  extended byti.swing.console.InputAdapter
      extended byti.swing.console.LogInputHandler
All Implemented Interfaces:
InputHandler

public class LogInputHandler
extends InputAdapter

The LogInputHandler class logs everything written to a console to an output stream.


Constructor Summary
LogInputHandler(Console console, java.io.OutputStream out)
          Class constructor.
LogInputHandler(Console console, java.io.Writer out)
          Class constructor.
 
Method Summary
 void append(char[] cbuf, int off, int len)
          Append characters to the end of the character stream.
 void close()
          Close method for doing any cleanup.
 void zap(int num)
          Delete characters from end of character stream.
 
Methods inherited from class ti.swing.console.InputAdapter
addRegion, getBufferLock, getData, getOffset, getRegions, lock, removeRegion, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogInputHandler

public LogInputHandler(Console console,
                       java.io.Writer out)
Class constructor.

Parameters:
console - the console view to which this input handler attaches to.
out - the output stream to log to

LogInputHandler

public LogInputHandler(Console console,
                       java.io.OutputStream out)
                throws java.io.IOException
Class constructor.

Parameters:
console - the console view to which this input handler attaches to.
out - the output stream to log to
Method Detail

append

public void append(char[] cbuf,
                   int off,
                   int len)
Append characters to the end of the character stream.

Specified by:
append in interface InputHandler
Overrides:
append in class InputAdapter
Parameters:
cbuf - the character buffer
off - the offset into cbuf to first character to append
len - the number of characters to append

zap

public void zap(int num)
Delete characters from end of character stream.

Specified by:
zap in interface InputHandler
Overrides:
zap in class InputAdapter
Parameters:
num - the number of characters to delete

close

public void close()
Description copied from class: InputAdapter
Close method for doing any cleanup.

Specified by:
close in interface InputHandler
Overrides:
close in class InputAdapter