public Object toArray ( ) { if ( listeners == EMPTY_OBJECT_ARRAY ) return Array . newInstance ( listenerClass , 0 ) ; Object [ ] listenersCopy = listeners ; Object copy = Array . newInstance ( listenerClass , listenersCopy . length ) ; System . arraycopy ( listenersCopy , 0 , copy , 0 , listenersCopy . length ) ; return copy ; }
Returns an object which is a copy of the collection of listeners registered with this instance .