net.rim.device.api.collection
Interface CollectionListener

All Known Subinterfaces:
BulkUpdateCollectionListener, ChainableCollection, CollectionListenerWithHint
All Known Implementing Classes:
BigSortedReadableList, BigUnsortedReadableList, IntSortedReadableList, LongSortedReadableList, ReadableListCombiner, SortedReadableList, UnsortedReadableList

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

reset

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

This collection should rebuild itself accordingly.

Parameters:
collection - Changed collection.

elementAdded

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

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

elementUpdated

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.

elementRemoved

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

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





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.