|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.deas.hyperenc.gui.GuiMessage
public class GuiMessage
A message with some extra fields for user interaction purposes. For example, a GuiMessage may have different states, as e-mails do in an e-mail client (read versus unread, and so on).
GuiMessages are immutable.
Constructor Summary | |
---|---|
GuiMessage(HyperMessage m,
ReadStatus read)
Construct a new GuiMessage around the given HyperMessage. |
Method Summary | |
---|---|
boolean |
equals(Object o)
Compares this GuiMessage to the specified object. |
String |
getContent()
Get the content of this GuiMessage. |
Date |
getDate()
Get the date of this GuiMessage. |
HyperMessage |
getHyperMessage()
Get the HyperMessage underlying this GuiMessage. |
int |
getID()
Get the unique ID of this GuiMessage. |
Contact |
getRecipient()
Get the recipient of this GuiMessage. |
Contact |
getSender()
Get the sender of this GuiMessage. |
String |
getSubject()
Get the subject of this GuiMessage. |
int |
hashCode()
Returns the hashCode() of the contained HyperMessage. |
boolean |
isEncrypted()
Whether this message is encrypted. |
ReadStatus |
isRead()
Whether this message has been read or not. |
static GuiMessage |
markRead(GuiMessage gm)
Returns a message whose fields are the same as those of gm ,
except the message is marked as read. |
static GuiMessage |
markUnread(GuiMessage gm)
Returns a message whose fields are the same as those of gm ,
except the message is marked as unread. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GuiMessage(HyperMessage m, ReadStatus read)
Method Detail |
---|
public HyperMessage getHyperMessage()
public int getID()
public String getSubject()
public Date getDate()
public Contact getSender()
public Contact getRecipient()
public String getContent()
public ReadStatus isRead()
public static GuiMessage markRead(GuiMessage gm)
gm
,
except the message is marked as read. After this method returns,
isRead()
returns ReadStatus.READ
.
If gm
is already marked as read, it is unspecified whether
the returned GuiMessage is the same object as gm
.
gm
- a message
gm
except that it is marked
as readpublic static GuiMessage markUnread(GuiMessage gm)
gm
,
except the message is marked as unread. After this method returns,
isRead()
returns ReadStatus.UNREAD
.
If gm
is already marked as unread, it is unspecified whether
the returned GuiMessage is the same object as gm
.
gm
- a message
gm
except that it is marked
as unreadpublic boolean isEncrypted()
true
if the message content is encrypted,
false
if notpublic boolean equals(Object o)
true
if and only if the argument is not null
and
is a GuiMessage object whose HyperMessage is equal to this GuiMessage's
HyperMessage. (The ReadStatus field of GuiMessage is ignored in the
equality comparison.)
equals
in class Object
public int hashCode()
hashCode()
of the contained HyperMessage.
hashCode
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |