commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject [collections] Observable next steps
Date Sat, 24 May 2003 10:55:28 GMT
Proposed design:

CollectionListener class:
 elementsAdded(CollectionChangeEvent)
 elementsRemoved(CollectionChangeEvent)
 elementsChanged(CollectionChangeEvent)

CollectionChangeEvent:
 Collection collection - the collection (current reference, ie. after
change)
 int numberChanged - the number of elements changing
 int changeIndex - for Lists, the index where the change starts
 Object changed - the value/collection being added/removed/changed
 boolean bulkOperation - true if addAll() etc. or clear()
 int oldSize - size before change
 int newSize - size after change
 boolean sizeChanged - (derived from previous two)

Maps would have their own listener and event.

Michael, you submitted a lot of code that could be extended to form this
design. Are you able and willing to do the work?

Notes:
- A second decorator() method should be added that takes in a Listener
- The decorator() methods should return ObservableXxx.

Stephen


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message