Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.communication.chat.ChatElement Class Reference

List of all members.

Public Types

enum  ChatElementType {
  MESSAGE, JOIN, LEAVE, MESSAGERECEPTION,
  STATECHANGE
}

Public Member Functions

 ChatElement (JID jid, Date date, ChatElementType type)
 ChatElement (String message, JID jid, Date date)
 ChatElement (Message message, Date date)
 ChatElement (JID jid, Date date, ChatState state)
JID getSender ()
Date getDate ()
Message getMessage ()
ChatElementType getChatElementType ()
ChatState getChatState ()
String toString ()

Detailed Description

Chat element class representing entries in the ChatHistory.


Member Enumeration Documentation

Represents the type of a chat element. For ChatElements, those types change their textual representation.

Enumerator:
MESSAGE 

Used to represent a chat message.

JOIN 

Used to represent a 'user joined'-notification.

LEAVE 

Used to represent a 'user left'-notification.

MESSAGERECEPTION 

Used to represent a confirmation for received messages.

STATECHANGE 

Used to represent a change of the ChatState.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.communication.chat.ChatElement.ChatElement ( JID  jid,
Date  date,
ChatElementType  type 
)

Create a chat element with the given chat element type. The message will be empty. This can be for example leave- and join-notifications.

Parameters:
jidJID of the user to whom the element refers to, e.g. which user joined or left
datedate of the occurrence, e.g. the joining or leaving
typetype of the new chat element
de.fu_berlin.inf.dpp.communication.chat.ChatElement.ChatElement ( String  message,
JID  jid,
Date  date 
)

Construct a chat element with the given message body. The type of this element will be ChatElementType#MESSAGE.

Parameters:
messagemessage body of the chat element
jidsender of the message
datedate the message has been received
de.fu_berlin.inf.dpp.communication.chat.ChatElement.ChatElement ( Message  message,
Date  date 
)

Construct a chat element that represents a normal chat message. The type of this element will be ChatElementType#MESSAGE.

Parameters:
messageThe message from which the body and the sender will be extracted
datedate the message has been received
de.fu_berlin.inf.dpp.communication.chat.ChatElement.ChatElement ( JID  jid,
Date  date,
ChatState  state 
)

Construct a chat element that represents a chat state change (type ChatElementType#STATECHANGE). The message will be empty.

Parameters:
jidJID of the user whose chat state has changed
datedate of the chat state change
statenew chat state

Member Function Documentation

ChatElementType de.fu_berlin.inf.dpp.communication.chat.ChatElement.getChatElementType ( )

Returns the ChatElementType.

Returns:
the ChatElementType
ChatState de.fu_berlin.inf.dpp.communication.chat.ChatElement.getChatState ( )

Returns the ChatState.

Returns:
the ChatState
Date de.fu_berlin.inf.dpp.communication.chat.ChatElement.getDate ( )

Returns the date the entry has been created.

Returns:
the date the entry has been created.
Message de.fu_berlin.inf.dpp.communication.chat.ChatElement.getMessage ( )

Returns a Message with the ChatElements JID and message body. The body will be null if there is no body to display.

Returns:
a Message with the ChatElements JID and message body
JID de.fu_berlin.inf.dpp.communication.chat.ChatElement.getSender ( )

Returns the sender/causer of the entry.

Returns:
the sender/causer of the entry
String de.fu_berlin.inf.dpp.communication.chat.ChatElement.toString ( )

Return typical representation of chat element.

 All Classes Namespaces Files Functions Variables Enumerations