Java Doc for MessageObject.java in  » 6.0-JDK-Modules » j2me » com » sun » tck » wma » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.tck.wma 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.tck.wma.MessageObject

MessageObject
abstract public class MessageObject implements Message(Code)
Implements a SMS message for the SMS message connection. This class contains methods for manipulating message objects and their contents. Messages can be composed of data and an address. MessageObject contains methods that can get and set the data and the address parts of a message separately. The data part can be either text or binary format. The address part has the format:

sms://[phone_number:][port_number]

and represents the address of a port that can accept or receive SMS messages.

MessageObjects are instantiated when they are received from the com.sun.tck.wma.MessageConnection MessageConnection or by using the MessageConnection.newMessage(String type)MessageConnection.newMessage message factory. Instances are freed when they are garbage-collected or when they go out of scope.



Field Summary
protected  StringmsgAddress
     High-level message address.
protected  StringmsgType
     High-level message type.
protected  longsentAt
     The time stamp for a message that was sent.

Constructor Summary
public  MessageObject(String type, String address)
     Creates a Message Object without a buffer.

Method Summary
public  StringgetAddress()
     Gets the address from the message object as a String.
abstract public  java.util.DategetTimestamp()
     Returns the timestamp indicating when this message has been sent.
abstract public  voidsetAddress(String addr)
     Sets the address part of the message object.
public  voidsetAddress(Message reference)
     (May be deleted) Set message address, copying the address from another message.
public  voidsetTimeStamp(long timestamp)
     Sets the timestamp for inbound SMS messages.

Field Detail
msgAddress
protected String msgAddress(Code)
High-level message address.



msgType
protected String msgType(Code)
High-level message type.



sentAt
protected long sentAt(Code)
The time stamp for a message that was sent.




Constructor Detail
MessageObject
public MessageObject(String type, String address)(Code)
Creates a Message Object without a buffer.
Parameters:
  type - The message type: TEXT, BINARY or MULTIPART.
Parameters:
  address - The destination address of the message.




Method Detail
getAddress
public String getAddress()(Code)
Gets the address from the message object as a String. If no address is found in the message, this method returns null. If the method is applied to an inbound message, the source address is returned. If it is applied to an outbound message, the destination address is returned.

The following code sample retrieves the address from a received message.

 ...
 Message msg = conn.receive();
 String addr = msg.getAddress();
 ...
 
... The address in string form, or null if no address was set.
See Also:   MessageObject.setAddress



getTimestamp
abstract public java.util.Date getTimestamp()(Code)
Returns the timestamp indicating when this message has been sent. Date indicating the timestamp in the message ornull if the timestamp is not set.
See Also:   MessageObject.setTimeStamp



setAddress
abstract public void setAddress(String addr)(Code)
Sets the address part of the message object. The address is a String and must be in the format: protocol://phone_number:[port] The following code sample assigns an address to the Message object.
 ...
 String addr = "protocol://+123456789";
 Message msg = newMessage(MessageConnection.TEXT_MESSAGE); 
 msg.setAddress(addr);
 ...
 

Parameters:
  addr - The address of the target device.
throws:
  IllegalArgumentException - if the address is not valid.
See Also:   MessageObject.getAddress



setAddress
public void setAddress(Message reference)(Code)
(May be deleted) Set message address, copying the address from another message.
Parameters:
  reference - the message who's address will be copied asthe new target address for this message.
exception:
  IllegalArgumentException - if the address is not valid
See Also:   MessageObject.getAddress



setTimeStamp
public void setTimeStamp(long timestamp)(Code)
Sets the timestamp for inbound SMS messages.
Parameters:
  timestamp - the date indicating the timestamp in the message
See Also:   MessageObject.getTimeStamp



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.