|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.collection.util.CollectionListenerManager
public class CollectionListenerManager
Class that can manage a list of CollectionListener objects that
register to receive collection events.
| Constructor Summary | ||
|---|---|---|
CollectionListenerManager()
Constructs a new CollectionListManager instance. |
||
| Method Summary | ||
|---|---|---|
void |
addCollectionListener(Object listener)
Registers a new collection listener. |
|
void |
clearOut()
Flush this manager's listener list. |
|
void |
fireElementAdded(Collection collection,
Object element)
Sends add event to the list of listeners. |
|
void |
fireElementRemoved(Collection collection,
Object element)
Sends remove event to the list of listeners. |
|
void |
fireElementUpdated(Collection collection,
Object oldElement,
Object newElement)
Sends update event to the list of listeners. |
|
void |
fireReset(Collection collection)
Sends reset event to the list of listeners. |
|
void |
forEachListener(Collection collection,
CollectionListenerAction action)
Performs a callback for each registered listener. |
|
boolean |
isEmpty()
Determines if this manager's listener list is empty. |
|
void |
removeCollectionListener(Object listener)
Unregisters a collection listener. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CollectionListenerManager()
| Method Detail |
|---|
public void addCollectionListener(Object listener)
addCollectionListener in interface CollectionEventSourcelistener - Collection event listener to add to this manager's list.
IllegalArgumentException - if listener is not an instance of CollectionListenerpublic void removeCollectionListener(Object listener)
removeCollectionListener in interface CollectionEventSourcelistener - Collection event listener to remove from this manager's
list.public void fireReset(Collection collection)
When this manager's associated collection drastically changes, it can send a reset message to its listeners managed by this manager. The listening collections should reset their collections (erase their contents and reload from the notifying source).
collection - Changed collection.
public void fireElementAdded(Collection collection,
Object element)
When this manager's associated collection adds a new element, it can send an add message to its listeners managed by this manager.
collection - Changed collection.element - Element added.
public void fireElementUpdated(Collection collection,
Object oldElement,
Object newElement)
When this manager's associated collection updates an element, it can send an update message to its listeners managed by this manager.
collection - Changed collection.oldElement - Element that was replaced.newElement - New element that replaced the old element.
public void fireElementRemoved(Collection collection,
Object element)
When this manager's associated collection removes an element, it can send a remove message to its listeners managed by this manager.
collection - Changed collection.element - Element removed.
public void forEachListener(Collection collection,
CollectionListenerAction action)
Invoke this method to prompt this manager's associated collection to perform an action for each registered listener.
collection - Collection to perform the action.action - Action to perform.public void clearOut()
Invoke this method to remove all the current listeners registered with this manager.
public boolean isEmpty()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.