|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.harvard.deas.hyperenc.gui.MessageStorage
public abstract class MessageStorage
Stores collections of GuiMessages. Supports retrieval of all GuiMessages from a particular sender.
The messages stored in a MessageStorage may be stored either by value or by
reference. This means that GuiMessages returned by the get*
methods might not be identical to those that were originally stored, but will
compare equal via the equals
method. (This requirement allows
for the possibility that an implementation may store messages on disk and
reconstruct them later, resulting in the same message with a different object
reference.)
Thread safety: Implementations of this class must be unconditionally thread-safe; concurrent access by multiple threads should be safe without the need for external synchronization.
Constructor Summary | |
---|---|
MessageStorage()
Default constructor. |
Method Summary | |
---|---|
abstract void |
addMessage(GuiMessage msg)
Put message in storage. |
abstract GuiMessage |
getMessage(int id)
Get message from this storage, given its ID. |
abstract Collection<GuiMessage> |
getMessagesBySender(Contact contact)
Get all stored messages sent from a particular contact. |
abstract GuiMessage |
removeMessage(int id)
Remove a message from storage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageStorage()
Method Detail |
---|
public abstract void addMessage(GuiMessage msg)
msg
- Message to be stored.public abstract GuiMessage getMessage(int id)
getID
method of GuiMessage.
id
- ID of desired message.
null
if
there is no such message stored.public abstract Collection<GuiMessage> getMessagesBySender(Contact contact)
contact
- contact of desired sender
public abstract GuiMessage removeMessage(int id)
id
- ID of message to be removed.
null
if there is no
such message stored.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |