net.sourceforge.mflow.api.base
Class AbstractMsgFolder

java.lang.Object
  extended bynet.sourceforge.mflow.api.base.AbstractMsgFlowComponent
      extended bynet.sourceforge.mflow.api.base.AbstractMsgFolder
All Implemented Interfaces:
Configurable, Iconable, MsgFlowComponent, MsgFolder

public abstract class AbstractMsgFolder
extends AbstractMsgFlowComponent
implements MsgFolder

Abstract implementation of MsgFolder

Version:
$Revision: 1.3 $
Author:
David Carr
To Do:
use generics to remove Msg[] parameters

Constructor Summary
AbstractMsgFolder()
           
 
Method Summary
 void addMsg(Msg m)
          Adds a message to the folder
 void addMsgChangeListener(MsgChangeListener listener)
          Adds a new listener
protected  void clear()
          Removes all messages from the folder
protected  void fireMsgChangeEvent()
          Fires a new MsgChangeEvent with this object as the source
protected  void fireMsgChangeEvent(MsgChangeEvent mce)
          Fires a MsgChangeEvent
protected  java.util.List getMessages()
           
 Msg[] getMsg()
          Gets all the messages
 Msg getMsg(int index)
          Gets a single Msg
 MsgChangeListener[] getMsgChangeListeners()
          Gets the current listeners
 int getNewMsgCount()
          Gets the number of new messages in the folder
 MsgFolder getParent()
          Gets the parent folder, or null if there isn't one
 int getUnreadMsgCount()
          Gets the number of unread messages in the folder
 boolean isRootFolder()
          Whether or not the folder is a root (no parent)
 void removeMsg(Msg m)
          Removes a msg from the folder
 void removeMsgChangeListener(MsgChangeListener aListener)
          Removes a MsgChangeListener
 void setMsg(int index, Msg msg)
          Sets a single Msg
 void setMsg(Msg[] msgs)
          Sets all the messages
 void setMsgChangeListeners(MsgChangeListener[] aListeners)
          Sets all the listeners
 void setParent(MsgFolder aParent)
          Sets the parent folder
 
Methods inherited from class net.sourceforge.mflow.api.base.AbstractMsgFlowComponent
configure, getIcon, getName, setIcon, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Constructor Detail

AbstractMsgFolder

public AbstractMsgFolder()
Method Detail

getMessages

protected final java.util.List getMessages()
Returns:
the messages in this folder

clear

protected final void clear()
Removes all messages from the folder


getMsg

public final Msg[] getMsg()
Gets all the messages

Specified by:
getMsg in interface MsgFolder
Returns:
an array of all Msgs contained in this folder

setMsg

public final void setMsg(Msg[] msgs)
Sets all the messages

Specified by:
setMsg in interface MsgFolder
Parameters:
msgs - the new msgs

getMsg

public final Msg getMsg(int index)
Gets a single Msg

Specified by:
getMsg in interface MsgFolder
Parameters:
index - the index of the Msg to get
Returns:
the Msg at the specified index

setMsg

public final void setMsg(int index,
                         Msg msg)
Sets a single Msg

Specified by:
setMsg in interface MsgFolder
Parameters:
index - the index of the Msg to set
msg - the Msg to set to the specified index

addMsg

public final void addMsg(Msg m)
Adds a message to the folder

Specified by:
addMsg in interface MsgFolder
Parameters:
m - the msg to add

removeMsg

public final void removeMsg(Msg m)
Removes a msg from the folder

Specified by:
removeMsg in interface MsgFolder
Parameters:
m - the msg to remove

getNewMsgCount

public final int getNewMsgCount()
Gets the number of new messages in the folder

Specified by:
getNewMsgCount in interface MsgFolder
Returns:
the number of new messages

getUnreadMsgCount

public final int getUnreadMsgCount()
Gets the number of unread messages in the folder

Specified by:
getUnreadMsgCount in interface MsgFolder
Returns:
the number of unread messages

addMsgChangeListener

public final void addMsgChangeListener(MsgChangeListener listener)
Adds a new listener

Specified by:
addMsgChangeListener in interface MsgFolder
Parameters:
listener - the new listener

getMsgChangeListeners

public final MsgChangeListener[] getMsgChangeListeners()
Gets the current listeners

Specified by:
getMsgChangeListeners in interface MsgFolder
Returns:
an array of the listeners

setMsgChangeListeners

public final void setMsgChangeListeners(MsgChangeListener[] aListeners)
Sets all the listeners

Specified by:
setMsgChangeListeners in interface MsgFolder
Parameters:
aListeners - an array of MsgChangeListeners

removeMsgChangeListener

public final void removeMsgChangeListener(MsgChangeListener aListener)
Removes a MsgChangeListener

Specified by:
removeMsgChangeListener in interface MsgFolder
Parameters:
aListener - the listener to remove

getParent

public final MsgFolder getParent()
Gets the parent folder, or null if there isn't one

Specified by:
getParent in interface MsgFolder
Returns:
the parent folder, or null

setParent

public final void setParent(MsgFolder aParent)
Sets the parent folder

Specified by:
setParent in interface MsgFolder
Parameters:
aParent - the new parent, or null to make it a root

isRootFolder

public final boolean isRootFolder()
Whether or not the folder is a root (no parent)

Specified by:
isRootFolder in interface MsgFolder
Returns:
whether or not the folder is a root

fireMsgChangeEvent

protected final void fireMsgChangeEvent()
Fires a new MsgChangeEvent with this object as the source


fireMsgChangeEvent

protected final void fireMsgChangeEvent(MsgChangeEvent mce)
Fires a MsgChangeEvent

Parameters:
mce - the event to fire


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