it.dtt.ca.history
Class Message

java.lang.Object
  extended by it.dtt.ca.history.HistoryItem
      extended by it.dtt.ca.history.Message
All Implemented Interfaces:
java.io.Serializable

public class Message
extends HistoryItem
implements java.io.Serializable

Class defining a message as an HistoryItem. The message is similar to an e-mail sent from the broadcaster to the user. The user can change the message status, dispose it, change its priority.

See Also:
Serialized Form

Field Summary
static int PRIORITYHIGH
          constant indicating a high priority message.
static int PRIORITYLOW
          constant indicating a low priority message.
static int PRIORITYNORMAL
          constant indicating a normal priority message.
 
Fields inherited from class it.dtt.ca.history.HistoryItem
DISPOSED, READ, UNREAD
 
Constructor Summary
protected Message(int id, java.lang.String message, int initialPriority, int status, java.util.Date date)
          Create a Message.
  Message(int id, java.lang.String subject, java.lang.String body, int initialPriority, int status, java.util.Date date)
          Create a Message.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getBody()
          Get the body of the message.
 int getId()
          Get the numeric identifier of the message.
 int getPriority()
          Get the priority of the message.
 java.lang.String getSubject()
          Get the subject of the message.
 
Methods inherited from class it.dtt.ca.history.HistoryItem
getDate, getStatus, markDisposed, markRead, markUnread
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIORITYLOW

public static final int PRIORITYLOW
constant indicating a low priority message.

See Also:
Constant Field Values

PRIORITYNORMAL

public static final int PRIORITYNORMAL
constant indicating a normal priority message.

See Also:
Constant Field Values

PRIORITYHIGH

public static final int PRIORITYHIGH
constant indicating a high priority message.

See Also:
Constant Field Values
Constructor Detail

Message

protected Message(int id,
                  java.lang.String message,
                  int initialPriority,
                  int status,
                  java.util.Date date)
Create a Message.

Parameters:
id - the identifier of this message.
message - the complete message.
initialPriority - the initial priority of the message.
status - the status of the message (@see it.dtt.ca.history.HistoryItem).
date - the date when the message was stored.

Message

public Message(int id,
               java.lang.String subject,
               java.lang.String body,
               int initialPriority,
               int status,
               java.util.Date date)
Create a Message.

Parameters:
id - the identifier of this message.
subject - the subject of the message.
body - the complete message.
initialPriority - the initial priority of the message.
status - the status of the message (@see it.dtt.ca.history.HistoryItem).
date - the date when the message was stored.
Method Detail

getSubject

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

Returns:
a String containig the subject of the message.

getBody

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

Returns:
a String containing the body of the message.

getId

public int getId()
Get the numeric identifier of the message.

Returns:
a number that identifies the message.

getPriority

public int getPriority()
Get the priority of the message. This information can be used to display the message in different way.

Returns:
the priority of the message. Can be either PRIORITYHIGH, PRIORITYNORMAL, PRIORITYLOW.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object