The main reason is that it makes it easier to remove a listener while 
processing an event. However, in practice, I don't think it is much more 
memory-intensive than an array list would be - for an array list, we'd need to 
allocate more memory than we expect to use, to avoid re-allocating and copying 
the list in order to grow it. Also, adds are more common than removes, and 
sequential iteration is the common case, so a linked list is a more natural 
choice.

On Aug 26, 2010, at 5:03 PM, Noel Grandin wrote:

> Hi
> 
> Is there a reason ListenerList is a linked list? I would have thought
> an array-list would be more memory efficient.
> 
> -- Noel

Reply via email to