blueme.messenger.common
Class MSG

java.lang.Object
  extended by java.util.Hashtable
      extended by blueme.messenger.common.SerUnser
          extended by blueme.messenger.common.MSG
All Implemented Interfaces:
iConstants, iMSG

public class MSG
extends SerUnser
implements iMSG, iConstants

This class will carry information about a message (incoming or outgoing)


Field Summary
 
Fields inherited from interface blueme.messenger.common.iConstants
ADMIN_UID, APP_TITLE, BLUETOOTH_INDEX, BLUETOOTH_LENGTH, BLUETOOTH_POSTFIX, BLUETOOTH_PREFIX, COM_OBJECTS, DISCOVERY_SLEEP, GPRS_INDEX, MAX_REDIRECTS, MSG_MAX_COUNT, MSG_MAX_LENGTH, NICK_MAX_LENGTH, PID_LENGTH, SMS_PUSH_PORT, UID_LENGTH
 
Constructor Summary
MSG()
          Creates a new instance of MSG
 
Method Summary
 int getCom()
          Get index of last communication module that handled this message.
 long getLocalSaveTime()
          Get message local creation time.
 java.lang.String getMessage()
          Get message content.
 java.lang.String getNick()
          Get senders nick.
 boolean getP2P()
          If true, this message may only be sent directly from one phone to the next.
 long getTime()
          Get message creation time.
 java.lang.String getUidReceiver()
          Get receivers UID.
 java.lang.String getUidSender()
          Get senders UID.
 boolean getUnreadFlag()
          Is this message unread?
 int getVersion()
          Get MSG class version.
 boolean isIncoming()
          Is this message incoming?
 boolean isOutgoing()
          Is this message outgoing?
 boolean isSystem()
          Is this a system message?
 boolean isText()
          Is this a text message?
 void setCom(int index)
          Set index of last communication module that handled this message.
 void setIncoming(boolean incoming)
          Define if this message is incoming.
 void setLocalSaveTime(long time)
          Set message local creation time.
 void setMessage(java.lang.String message)
          Set message content.
 void setNick(java.lang.String nick)
          Set senders nick.
 void setOutgoing(boolean outgoing)
          Define if this message is outgoing.
 void setP2P(boolean flag)
          If true, this message may only be sent directly from one phone to the next.
 void setSystem(boolean system)
          Define if this message is a system message.
 void setText(boolean text)
          Define if this message is a text message.
 void setTime(long time)
          Set message creation time.
 void setUidReceiver(java.lang.String uid)
          Set receivers UID.
 void setUidSender(java.lang.String uid)
          Set senders UID.
 void setUnreadFlag(boolean flag)
          Define if this message is unread or not.
 
Methods inherited from class blueme.messenger.common.SerUnser
get, put, serialize, unserialize
 
Methods inherited from class java.util.Hashtable
clear, contains, containsKey, elements, isEmpty, keys, rehash, remove, size, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface blueme.messenger.common.iMSG
serialize, unserialize
 

Constructor Detail

MSG

public MSG()
Creates a new instance of MSG

Method Detail

getUidReceiver

public java.lang.String getUidReceiver()
                                throws java.lang.NullPointerException
Description copied from interface: iMSG
Get receivers UID.

Specified by:
getUidReceiver in interface iMSG
Throws:
java.lang.NullPointerException

getUidSender

public java.lang.String getUidSender()
                              throws java.lang.NullPointerException
Description copied from interface: iMSG
Get senders UID.

Specified by:
getUidSender in interface iMSG
Throws:
java.lang.NullPointerException

getCom

public int getCom()
           throws java.lang.NullPointerException
Description copied from interface: iMSG
Get index of last communication module that handled this message.

Specified by:
getCom in interface iMSG
Throws:
java.lang.NullPointerException

getUnreadFlag

public boolean getUnreadFlag()
Description copied from interface: iMSG
Is this message unread?

Specified by:
getUnreadFlag in interface iMSG

getMessage

public java.lang.String getMessage()
                            throws java.lang.NullPointerException
Description copied from interface: iMSG
Get message content.

Specified by:
getMessage in interface iMSG
Throws:
java.lang.NullPointerException

getNick

public java.lang.String getNick()
                         throws java.lang.NullPointerException
Description copied from interface: iMSG
Get senders nick.

Specified by:
getNick in interface iMSG
Throws:
java.lang.NullPointerException

getP2P

public boolean getP2P()
Description copied from interface: iMSG
If true, this message may only be sent directly from one phone to the next. In other words, this will only allow us to use Bluetooth.

Specified by:
getP2P in interface iMSG

getTime

public long getTime()
             throws java.lang.NullPointerException
Description copied from interface: iMSG
Get message creation time.

Specified by:
getTime in interface iMSG
Throws:
java.lang.NullPointerException

isIncoming

public boolean isIncoming()
Description copied from interface: iMSG
Is this message incoming?

Specified by:
isIncoming in interface iMSG

isOutgoing

public boolean isOutgoing()
Description copied from interface: iMSG
Is this message outgoing?

Specified by:
isOutgoing in interface iMSG

isSystem

public boolean isSystem()
Description copied from interface: iMSG
Is this a system message?

Specified by:
isSystem in interface iMSG

isText

public boolean isText()
Description copied from interface: iMSG
Is this a text message?

Specified by:
isText in interface iMSG

setUidReceiver

public void setUidReceiver(java.lang.String uid)
                    throws java.lang.StringIndexOutOfBoundsException
Description copied from interface: iMSG
Set receivers UID.

Specified by:
setUidReceiver in interface iMSG
Throws:
java.lang.StringIndexOutOfBoundsException

setUidSender

public void setUidSender(java.lang.String uid)
                  throws java.lang.StringIndexOutOfBoundsException
Description copied from interface: iMSG
Set senders UID.

Specified by:
setUidSender in interface iMSG
Throws:
java.lang.StringIndexOutOfBoundsException

setCom

public void setCom(int index)
            throws java.lang.IndexOutOfBoundsException
Description copied from interface: iMSG
Set index of last communication module that handled this message.

Specified by:
setCom in interface iMSG
Throws:
java.lang.IndexOutOfBoundsException

setUnreadFlag

public void setUnreadFlag(boolean flag)
Description copied from interface: iMSG
Define if this message is unread or not.

Specified by:
setUnreadFlag in interface iMSG

setIncoming

public void setIncoming(boolean incoming)
Description copied from interface: iMSG
Define if this message is incoming.

Specified by:
setIncoming in interface iMSG

setMessage

public void setMessage(java.lang.String message)
                throws java.lang.StringIndexOutOfBoundsException
Description copied from interface: iMSG
Set message content.

Specified by:
setMessage in interface iMSG
Throws:
java.lang.StringIndexOutOfBoundsException

setNick

public void setNick(java.lang.String nick)
Description copied from interface: iMSG
Set senders nick.

Specified by:
setNick in interface iMSG

setOutgoing

public void setOutgoing(boolean outgoing)
Description copied from interface: iMSG
Define if this message is outgoing.

Specified by:
setOutgoing in interface iMSG

setP2P

public void setP2P(boolean flag)
Description copied from interface: iMSG
If true, this message may only be sent directly from one phone to the next. In other words, this will only allow us to use Bluetooth.

Specified by:
setP2P in interface iMSG

setSystem

public void setSystem(boolean system)
Description copied from interface: iMSG
Define if this message is a system message.

Specified by:
setSystem in interface iMSG

setText

public void setText(boolean text)
Description copied from interface: iMSG
Define if this message is a text message.

Specified by:
setText in interface iMSG

setTime

public void setTime(long time)
Description copied from interface: iMSG
Set message creation time.

Specified by:
setTime in interface iMSG

getVersion

public int getVersion()
Description copied from interface: iMSG
Get MSG class version.

Specified by:
getVersion in interface iMSG

getLocalSaveTime

public long getLocalSaveTime()
                      throws java.lang.NullPointerException
Description copied from interface: iMSG
Get message local creation time.

Specified by:
getLocalSaveTime in interface iMSG
Throws:
java.lang.NullPointerException

setLocalSaveTime

public void setLocalSaveTime(long time)
Description copied from interface: iMSG
Set message local creation time.

Specified by:
setLocalSaveTime in interface iMSG