simulator
Class Typist

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--simulator.Typist

class Typist
extends java.lang.Thread

A thread-class that handle the text typist in an TextField and send message to the server


Field Summary
protected  Client applet
          Contains the instance to the applet
protected  long lineId
          This is a line identifier used by RTT
protected  boolean running
          This flag indicates if typist is running
protected  java.io.PrintStream sout
          This is the output stream where we write on
protected  java.awt.TextField window
          Contain the line that the client users write
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
Typist(java.net.Socket s, java.awt.TextField window, Client applet)
          Initilaize object: create new streams and start thread
 
Method Summary
protected  void finalize()
          This method is provide only for the garbage collection handler for release the not available space
 void run()
          This only set a variable to comunicate that it's running ok, then exit from thread body becouse the method to call is sendline and it is done by the Client class
 void sendLine()
          Send the readed line to the output stream
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sout

protected java.io.PrintStream sout
This is the output stream where we write on

window

protected java.awt.TextField window
Contain the line that the client users write

running

protected boolean running
This flag indicates if typist is running

applet

protected Client applet
Contains the instance to the applet

lineId

protected long lineId
This is a line identifier used by RTT
Constructor Detail

Typist

public Typist(java.net.Socket s,
              java.awt.TextField window,
              Client applet)
Initilaize object: create new streams and start thread
Parameters:
s - the socket to comunicate
window - a TextFiled where we insert line
applet - an applet of the Client type
Method Detail

run

public void run()
This only set a variable to comunicate that it's running ok, then exit from thread body becouse the method to call is sendline and it is done by the Client class
Overrides:
run in class java.lang.Thread

finalize

protected void finalize()
                 throws java.lang.Throwable
This method is provide only for the garbage collection handler for release the not available space
Overrides:
finalize in class java.lang.Object

sendLine

public void sendLine()
Send the readed line to the output stream