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
-
message
- String indicating the message if any
-
Message(String)
- Creates an instance of message with the specified string
-
Message(int)
- Creates an instance of message with the default string of ``message''
-
Message(String, int)
- Creates an instance of message with the specified id and message.
-
Message(DataInputStream)
- Creates an instance of message from the input steam.
-
IsValid()
- Useful to find out if there is any string data in the message
-
addnext(String)
- Helper method to add more message data to the existing buffer
-
addnext(char)
- Helper method to add more message data to the existing buffer
-
basedepacketize(DataInputStream)
- Helper routine for Stream based constructor.
-
basepacketize(DataOutputStream)
- Helper method for packing all the base class member variables required
for this representation into a byte array.
-
getMessage()
- Method to extract the message string from the Message Unit
-
packetize(DataOutputStream)
- Uses the basepacketize helper method and then packs the remain'g data
and then sync's data to the Stream.
-
print()
- Helper routine for testing purposes.
-
sethashkey(int)
- Method to set the hashcode designed for messages like ODELETE
message
protected StringBuffer message
- String indicating the message if any
Message
public Message(String arg)
- Creates an instance of message with the specified string
- Parameters:
- arg - the string containing the description of message
Message
public Message(int arg)
- Creates an instance of message with the default string of ``message''
- Parameters:
- arg - the int identifying the type.
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
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
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
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
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
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
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
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
print
public void print()
- Helper routine for testing purposes.
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
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