com.beem.project.beem.service
Class Message

Package class diagram package Message
java.lang.Object
  extended by com.beem.project.beem.service.Message
All Implemented Interfaces:
Parcelable

public class Message
extends Object
implements Parcelable

This class represents a instant message.


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
Parcelable.Creator<T>
 
Field Summary
static Parcelable.Creator<Message> CREATOR
          Parcelable.Creator needs by Android.
static int MSG_TYPE_CHAT
          Chat message type.
static int MSG_TYPE_ERROR
          Error message type.
static int MSG_TYPE_GROUP_CHAT
          Group chat message type.
static int MSG_TYPE_INFO
          Informational message type.
static int MSG_TYPE_NORMAL
          Normal message type.
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
Message(Message smackMsg)
          Construct a message from a smack message packet.
Message(String to)
          Constructor a message of type chat.
Message(String to, int type)
          Constructor.
 
Method Summary
 int describeContents()
          
 String getBody()
          Get the body of the message.
 String getFrom()
          Get the from field of the message.
 String getSubject()
          Get the subject of the message.
 String getThread()
          Get the thread of the message.
 Date getTimestamp()
          Get the Date of the message.
 String getTo()
          Get the destinataire of the message.
 int getType()
          Get the type of the message.
 void setBody(String body)
          Set the body of the message.
 void setFrom(String from)
          Set the from field of the message.
 void setSubject(String subject)
          Set the subject of the message.
 void setThread(String thread)
          Set the thread of the message.
 void setTimestamp(Date date)
          Set the Date of the message.
 void setTo(String to)
          Set the destinataire of the message.
 void setType(int type)
          Set the type of the message.
 void writeToParcel(Parcel dest, int flags)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_TYPE_NORMAL

public static final int MSG_TYPE_NORMAL
Normal message type. Theese messages are like an email, with subject.

See Also:
Constant Field Values

MSG_TYPE_CHAT

public static final int MSG_TYPE_CHAT
Chat message type.

See Also:
Constant Field Values

MSG_TYPE_GROUP_CHAT

public static final int MSG_TYPE_GROUP_CHAT
Group chat message type.

See Also:
Constant Field Values

MSG_TYPE_ERROR

public static final int MSG_TYPE_ERROR
Error message type.

See Also:
Constant Field Values

MSG_TYPE_INFO

public static final int MSG_TYPE_INFO
Informational message type.

See Also:
Constant Field Values

CREATOR

public static final Parcelable.Creator<Message> CREATOR
Parcelable.Creator needs by Android.

Constructor Detail

Message

public Message(String to,
               int type)
Constructor.

Parameters:
to - the destinataire of the message
type - the message type

Message

public Message(String to)
Constructor a message of type chat.

Parameters:
to - the destinataire of the message

Message

public Message(Message smackMsg)
Construct a message from a smack message packet.

Parameters:
smackMsg - Smack message packet
Method Detail

writeToParcel

public void writeToParcel(Parcel dest,
                          int flags)

Specified by:
writeToParcel in interface Parcelable

getType

public int getType()
Get the type of the message.

Returns:
the type of the message.

setType

public void setType(int type)
Set the type of the message.

Parameters:
type - the type to set

getBody

public String getBody()
Get the body of the message.

Returns:
the Body of the message

setBody

public void setBody(String body)
Set the body of the message.

Parameters:
body - the body to set

getSubject

public String getSubject()
Get the subject of the message.

Returns:
the subject

setSubject

public void setSubject(String subject)
Set the subject of the message.

Parameters:
subject - the subject to set

getTo

public String getTo()
Get the destinataire of the message.

Returns:
the destinataire of the message

setTo

public void setTo(String to)
Set the destinataire of the message.

Parameters:
to - the destinataire to set

setFrom

public void setFrom(String from)
Set the from field of the message.

Parameters:
from - the mFrom to set

getFrom

public String getFrom()
Get the from field of the message.

Returns:
the mFrom

getThread

public String getThread()
Get the thread of the message.

Returns:
the thread

setThread

public void setThread(String thread)
Set the thread of the message.

Parameters:
thread - the thread to set

setTimestamp

public void setTimestamp(Date date)
Set the Date of the message.

Parameters:
date - date of the message.

getTimestamp

public Date getTimestamp()
Get the Date of the message.

Returns:
if it is a delayed message get the date the message was sended.

describeContents

public int describeContents()

Specified by:
describeContents in interface Parcelable


Copyright © 2009 Beem-project.com. All Rights Reserved.