next up previous contents
Next: MessageListener interface Up: Library usage Previous: Objects overview   Contents

Message object

Figure 3.1: Message object
\includegraphics{images/java_message.eps}

Message object stores informations about the message.

The list of public method is reported here:

-Message()
Build an empty message.


-Message(String command)
Build a message with a defined command.


-Message(String command, String parameter)
Build a message with a specified command and a single parameter.


-addParameter(String parameter)
Add a parameter to the message.


-addParameter(int parameter)
Add an integer parameter to the message.
Note! the internal rapresentation of the parameters is String.


-String getCommand()
Return the command associated with the message.


-int getParCount()
Get the number of registered parameters.


-String getParameter(int index)
Get a specified parameter.


-int getIntParameter(int index)
throws NumberFormatException
Get a specified parameter converted in integer. If the format of the string is not an integer rapresentation the method throws a NumberFormatException.


-String getNextParameter()
Return the next parameter during sequential access or null if there are no more parameters.


-boolean hasMorePars()
Return true if there are more parameters, false otherwise.


-resetParCount()
Reset the internal index of the parameters, used with getNextParameter() method.



2005-07-12