Class wb.Message
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class wb.Message

java.lang.Object
   |
   +----wb.GraphUnit
           |
           +----wb.Message

public class Message
extends GraphUnit
An extension of the GraphUnit to handle messages as a special case of graph objects. However, these are identified by the base class member variable ``type''. Designed to handle all aspects of Message Passing required in maintainence of Conference It is well known that message id's are sufficient in most cases, (say) Clear the screen, An integer may denote the Clear. However, in some cases like Delete 'g an object would require both the Message id and object id. Hence, a member variable string buffer is attached to this class.
See Also:
GraphUnit@type, GTypes

Variable Index

 o message
String indicating the message if any

Constructor Index

 o Message(String)
Creates an instance of message with the specified string
 o Message(int)
Creates an instance of message with the default string of ``message''
 o Message(String, int)
Creates an instance of message with the specified id and message.
 o Message(DataInputStream)
Creates an instance of message from the input steam.

Method Index

 o IsValid()
Useful to find out if there is any string data in the message
 o addnext(String)
Helper method to add more message data to the existing buffer
 o addnext(char)
Helper method to add more message data to the existing buffer
 o basedepacketize(DataInputStream)
Helper routine for Stream based constructor.
 o basepacketize(DataOutputStream)
Helper method for packing all the base class member variables required for this representation into a byte array.
 o getMessage()
Method to extract the message string from the Message Unit
 o packetize(DataOutputStream)
Uses the basepacketize helper method and then packs the remain'g data and then sync's data to the Stream.
 o print()
Helper routine for testing purposes.
 o sethashkey(int)
Method to set the hashcode designed for messages like ODELETE

Variables

 o message
  protected StringBuffer message
String indicating the message if any

Constructors

 o Message
  public Message(String arg)
Creates an instance of message with the specified string
Parameters:
arg - the string containing the description of message
 o Message
  public Message(int arg)
Creates an instance of message with the default string of ``message''
Parameters:
arg - the int identifying the type.
 o Message
  public Message(String arg1,
                 int arg2)
Creates an instance of message with the specified id and message. validates the the message id, and defaults it to the base value
Parameters:
arg1 - the String of the message
arg2 - the int identifying the message id
 o Message
  public Message(DataInputStream din) throws IOException
Creates an instance of message from the input steam. and constructs all the required data.
Parameters:
din - the DataInputStream from which the data is read
Throws: IOException
if an I/O Error has occured
See Also:
basedepacketize

Methods

 o basedepacketize
  protected void basedepacketize(DataInputStream din) throws IOException
Helper routine for Stream based constructor. Unpacks the data from the DataInputSteam and fills up the member variables
Parameters:
din, - DataInputStream from which the data is read.
Throws: IOException,
throws IOException when there is a read error
Overrides:
basedepacketize in class GraphUnit
See Also:
basepacketize, ByteUnPackInputStream
 o basepacketize
  protected void basepacketize(DataOutputStream dos) throws IOException
Helper method for packing all the base class member variables required for this representation into a byte array.
Parameters:
dos, - DataOutputStream to which the data is to be written.
Throws: IOException,
throws IOException when there is a read error
Overrides:
basepacketize in class GraphUnit
See Also:
basedepacketize, BytePackOutputStream
 o packetize
  public void packetize(DataOutputStream dos) throws IOException
Uses the basepacketize helper method and then packs the remain'g data and then sync's data to the Stream.
Parameters:
dos - the DataOutputStream on to which the data is written
Throws: IOException
if I/O Error occurs
Overrides:
packetize in class GraphUnit
See Also:
basepacketize, packetize
 o addnext
  public void addnext(String chardata)
Helper method to add more message data to the existing buffer
Parameters:
chardata - the string to be appended to the message
Overrides:
addnext in class GraphUnit
 o addnext
  public void addnext(char x)
Helper method to add more message data to the existing buffer
Parameters:
x - the char to be appended to the message
Overrides:
addnext in class GraphUnit
 o getMessage
  public String getMessage()
Method to extract the message string from the Message Unit
Returns:
String the string data that is embedded in the message Unit
 o print
  public void print()
Helper routine for testing purposes.
 o IsValid
  public boolean IsValid()
Useful to find out if there is any string data in the message
Returns:
boolean true iff there is any string data in the message
 o sethashkey
  public void sethashkey(int hashcode)
Method to set the hashcode designed for messages like ODELETE

All Packages  Class Hierarchy  This Package  Previous  Next  Index