net.rim.device.api.collection
Interface CollectionListener

All Known Subinterfaces:
BulkUpdateCollectionListener, ChainableCollection, CollectionListenerWithHint

public interface CollectionListener

Defines functionality required of collection event listeners.

In order to receive collection events from collection sources (those that implement CollectionEventSource) an object implementing this interface must register itself with the source collection.


Method Summary
 void elementAdded(Collection collection, Object element)
          Monitored collection has added an element.
 void elementRemoved(Collection collection, Object element)
          Monitored collection has removed an element.
 void elementUpdated(Collection collection, Object oldElement, Object newElement)
          Monitored collection has replaced an existing element with a new one.
 void reset(Collection collection)
          Monitored collection has changed drastically.
 

Method Detail

elementAdded

public void elementAdded(Collection collection,
                         Object element)
Monitored collection has added an element.

Parameters:
collection - Changed collection.
element - Element added to the monitored collection.

elementRemoved

public void elementRemoved(Collection collection,
                           Object element)
Monitored collection has removed an element.

Parameters:
collection - Changed collection.
element - Element removed from the monitored collection.

elementUpdated

public void elementUpdated(Collection collection,
                           Object oldElement,
                           Object newElement)
Monitored collection has replaced an existing element with a new one.

Parameters:
collection - Changed collection.
oldElement - Pre-existing element that was replaced.
newElement - New element that replaced the pre-existing one.

reset

public void reset(Collection collection)
Monitored collection has changed drastically.

This collection should rebuild itself accordingly.

Parameters:
collection - Changed collection.



Copyright 1999-2009 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.