Class COM.roguewave.jchat.Reader
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.roguewave.jchat.Reader

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----COM.roguewave.jchat.Reader

public class Reader
extends Thread
The Reader class.

The Reader class is implemented as a specialized Thread with the sole responsibility of monitoring incoming data on an instance of a DataInputStream. The Reader reads in lines (terminated with '\n') as separate commands that make up a command set. The Dispatcher is notified once a complete command set is received from the DataInputStream.

See Also:
DataInputStream, Dispatcher

Constructor Index

 o Reader(DataInputStream, int, Dispatcher)
Creates a Reader.

Method Index

 o readData()
Helper method for reading data from the input stream.
 o run()
The body of the Reader.

Constructors

 o Reader
  public Reader(DataInputStream aInputStream,
                int aInt,
                Dispatcher aDispatcher)
Creates a Reader. The Reader monitors the specified DataInputStream until the specified number of commands are received. The specified Dispatcher is then asked to process the command.

Methods

 o run
  public void run()
The body of the Reader. Continuously monitors a non-null input stream, alerting a Dispatcher when a complete command set is received.
Overrides:
run in class Thread
 o readData
  public String readData()
Helper method for reading data from the input stream. This method should not be used by any method other than this.run() after the thread for an instance of a Reader is started.

All Packages  Class Hierarchy  This Package  Previous  Next  Index