net.sourceforge.mflow.api
Interface MsgFolder

All Superinterfaces:
Configurable, Iconable, MsgFlowComponent
All Known Subinterfaces:
ReceiveFolder, SendFolder
All Known Implementing Classes:
AbstractMsgFolder

public interface MsgFolder
extends MsgFlowComponent

Interface for the storage of Msgs

Version:
$Revision: 1.4 $
Author:
David Carr

Method Summary
 void addMsg(Msg m)
          Adds a Msg to the folder
 void addMsgChangeListener(MsgChangeListener listener)
          Adds a listener for MsgChangeEvents.
 Msg[] getMsg()
          Accessor for all of the Msgs contained in the folder
 Msg getMsg(int index)
          Accessor for a single Msg in the folder
 MsgChangeListener[] getMsgChangeListeners()
          Accessor for all of the listeners for the folder.
 int getNewMsgCount()
          Gets the number of new Msgs in the folder If this information is not current available, returns -1
 MsgFolder getParent()
          Gets a reference to the parent folder
 int getUnreadMsgCount()
          Gets the number of unread Msgs in the folder If this information is not current available, returns -1
 boolean isRootFolder()
          Returns whether or not this folder is a root folder (no parent)
 void removeMsg(Msg m)
          Removes a Msg from the folder.
 void removeMsgChangeListener(MsgChangeListener listener)
          Removes a listener from the folder.
 void setMsg(int index, Msg msg)
          Mutator for a single Msg in the folder
 void setMsg(Msg[] msgs)
          Mutator for all of the Msgs contained in the folder
 void setMsgChangeListeners(MsgChangeListener[] listeners)
          Mutator for all of the listeners for the folder.
 void setParent(MsgFolder parent)
          Sets the parent for the folder
 
Methods inherited from interface net.sourceforge.mflow.api.MsgFlowComponent
getName, setName
 
Methods inherited from interface net.sourceforge.mflow.api.Configurable
configure
 
Methods inherited from interface net.sourceforge.mflow.api.Iconable
getIcon
 

Method Detail

getMsg

Msg[] getMsg()
Accessor for all of the Msgs contained in the folder

Returns:
an array of Msgs

setMsg

void setMsg(Msg[] msgs)
Mutator for all of the Msgs contained in the folder

Parameters:
msgs - an array of Msgs to replace the current contents of the folder

getMsg

Msg getMsg(int index)
Accessor for a single Msg in the folder

Parameters:
index - the index of the Msg
Returns:
the Msg at the specified index

setMsg

void setMsg(int index,
            Msg msg)
Mutator for a single Msg in the folder

Parameters:
index - the index
msg - the Msg to set at the specified index

addMsg

void addMsg(Msg m)
Adds a Msg to the folder

Parameters:
m - the Msg to add to the folder

removeMsg

void removeMsg(Msg m)
Removes a Msg from the folder. Will not complain if the specified Msg is not in the folder.

Parameters:
m - the Msg to remove from the folder

getNewMsgCount

int getNewMsgCount()
Gets the number of new Msgs in the folder If this information is not current available, returns -1

Returns:
the number of new Msgs in the folder, or -1 if this information is unavailable

getUnreadMsgCount

int getUnreadMsgCount()
Gets the number of unread Msgs in the folder If this information is not current available, returns -1

Returns:
the number of unread Msgs in the folder, or -1 if this information is unavailable

addMsgChangeListener

void addMsgChangeListener(MsgChangeListener listener)
Adds a listener for MsgChangeEvents. These events are thrown whenever a Msg is added or removed from the folder.

Parameters:
listener - the new listener to add

getMsgChangeListeners

MsgChangeListener[] getMsgChangeListeners()
Accessor for all of the listeners for the folder.

Returns:
an array of MsgChangeListeners

setMsgChangeListeners

void setMsgChangeListeners(MsgChangeListener[] listeners)
Mutator for all of the listeners for the folder.

Parameters:
listeners - an array of MsgChangeListeners containing the new listeners for the folder

removeMsgChangeListener

void removeMsgChangeListener(MsgChangeListener listener)
Removes a listener from the folder. Does not complain if the listener was not listening to this folder.

Parameters:
listener - the listener to remove

getParent

MsgFolder getParent()
Gets a reference to the parent folder

Returns:
the parent folder, or null if this folder doesn't have a parent

setParent

void setParent(MsgFolder parent)
Sets the parent for the folder

Parameters:
parent - the new parent folder, or null to make the folder a root

isRootFolder

boolean isRootFolder()
Returns whether or not this folder is a root folder (no parent)

Returns:
true if this folder is a root folder


Copyright © 2002-2004 MFlow Group. All Rights Reserved.