neto
Class ProtocolMessageEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byneto.ProtocolMessageEvent
All Implemented Interfaces:
java.io.Serializable

public class ProtocolMessageEvent
extends java.util.EventObject

Object used by ProtocolMessageListener. The ProtocolMessage event shows information about the transfer of data. It shows error messages and the status of transfer of files. This event shows from which serial port the messages comes and if the message stops the protocol or that the protocol continuous after the message. Every message has it own unique code, to simplify translating messages to the language of need. Every message has also it's own textual information part. The text part matches the status code.

Author:
Vincent Ramp
See Also:
ProtocolMessageListener, Serialized Form

Constructor Summary
ProtocolMessageEvent(java.lang.Object source, int code, java.lang.String msg, short ends, java.lang.String port)
          Initializes a new instance of this object.
 
Method Summary
 short GetFinal()
          Returns wether the message ends the protocol or not.
 java.lang.String GetMessage()
          Returns a string expression that explains the status code.
 int GetMsgCode()
          Returns the integer expression that specifies the status code.
 java.lang.String getPort()
          Returns a string that specifies which serial port the message comes from.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProtocolMessageEvent

public ProtocolMessageEvent(java.lang.Object source,
                            int code,
                            java.lang.String msg,
                            short ends,
                            java.lang.String port)
Initializes a new instance of this object. It also sets the integer and string representation of the message, as well as the serial port wich was used when this message was fired, and wether the protocol ends or not.

Parameters:
source - object wich created this ProtocolMessageEvent object.
code - an integer expression that specifies the status code.
msg - a string expression that explains the status code.
ends - a short integer expression that specifies if this message ends the protocol. If ends is 1 than the protocol is stopped, when ends is 0 the protocol keeps running
port - a string that specifies which serial port the message comes from.
Method Detail

GetFinal

public short GetFinal()
Returns wether the message ends the protocol or not.

Returns:
1: protocol is stopped, 0: protocol keeps running.

GetMessage

public java.lang.String GetMessage()
Returns a string expression that explains the status code.

Returns:
The status message.

GetMsgCode

public int GetMsgCode()
Returns the integer expression that specifies the status code.

Returns:
The status code.

getPort

public java.lang.String getPort()
Returns a string that specifies which serial port the message comes from.

Returns:
The serial port wich launches this message.