com.nokia.mid.messaging
Interface Message

All Known Subinterfaces:
BinaryMessage, TextMessage

public interface Message

Base interface representing a message

This interface contains the functionality common to all messages. Concrete object instances representing a message will typically implement other (sub)interfaces providing access to the content and other information in the message which is dependent on the type of the message.

Object instances implementing this interface are just containers for the data that is passed in. The setXxx() methods just set the values of the parameters in the data container without any checking whether the value is valid in any way for the respective parameter.


Method Summary
 java.lang.String getAddress()
          Returns the address associated with this message.
 java.util.Date getTimestamp()
          Returns the timestamp indicating when this message has been sent.
 void setAddress(java.lang.String addr)
          Sets the message associated with this message, i.e. the address returned by the getAddress method.
 

Method Detail

getAddress

public java.lang.String getAddress()

Returns the address associated with this message.

If this is a message to be sent, this address is the address of the recipient.

If this is a message that has been received, this address is the sender's address.

Returns null if the address for the message is not set.

Note: This design allows sending responses to a received message easily by reusing the same Message object and just replacing the payload. The address field can normally be kept untouched (unless the used messaging protocol requires some special handling of the address).

Returns:
the address of this message

setAddress

public void setAddress(java.lang.String addr)
Sets the message associated with this message, i.e. the address returned by the getAddress method.

Parameters:
addr - address for the message

getTimestamp

public java.util.Date getTimestamp()
Returns the timestamp indicating when this message has been sent.

Returns:
Date indicating the timestamp in the message or null if the timestamp is not set.

forum.nokia.com/java

Copyright (c) 2002 Nokia Mobile Phones. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc.