83 * foo should be changed to the appropriate name, and fireFooXxx to the
84 * appropriate method name. One fire method should exist for each
85 * notification method in the FooListener interface.
86 * <p>
87 * <strong>Warning:</strong>
88 * Serialized objects of this class will not be compatible with
89 * future Swing releases. The current serialization support is
90 * appropriate for short term storage or RMI between applications running
91 * the same version of Swing. As of 1.4, support for long term storage
92 * of all JavaBeans™
93 * has been added to the <code>java.beans</code> package.
94 * Please see {@link java.beans.XMLEncoder}.
95 *
96 * @author Georges Saab
97 * @author Hans Muller
98 * @author James Gosling
99 */
100 @SuppressWarnings("serial")
101 public class EventListenerList implements Serializable {
102 /* A null array to be shared by all empty listener lists*/
103 private final static Object[] NULL_ARRAY = new Object[0];
104 /** The list of ListenerType - Listener pairs */
105 protected transient Object[] listenerList = NULL_ARRAY;
106
107 /**
108 * Passes back the event listener list as an array
109 * of ListenerType-listener pairs. Note that for
110 * performance reasons, this implementation passes back
111 * the actual data structure in which the listener data
112 * is stored internally!
113 * This method is guaranteed to pass back a non-null
114 * array, so that no null-checking is required in
115 * fire methods. A zero-length array of Object should
116 * be returned if there are currently no listeners.
117 *
118 * WARNING!!! Absolutely NO modification of
119 * the data contained in this array should be made -- if
120 * any such manipulation is necessary, it should be done
121 * on a copy of the array returned rather than the array
122 * itself.
123 *
|
83 * foo should be changed to the appropriate name, and fireFooXxx to the
84 * appropriate method name. One fire method should exist for each
85 * notification method in the FooListener interface.
86 * <p>
87 * <strong>Warning:</strong>
88 * Serialized objects of this class will not be compatible with
89 * future Swing releases. The current serialization support is
90 * appropriate for short term storage or RMI between applications running
91 * the same version of Swing. As of 1.4, support for long term storage
92 * of all JavaBeans™
93 * has been added to the <code>java.beans</code> package.
94 * Please see {@link java.beans.XMLEncoder}.
95 *
96 * @author Georges Saab
97 * @author Hans Muller
98 * @author James Gosling
99 */
100 @SuppressWarnings("serial")
101 public class EventListenerList implements Serializable {
102 /* A null array to be shared by all empty listener lists*/
103 private static final Object[] NULL_ARRAY = new Object[0];
104 /** The list of ListenerType - Listener pairs */
105 protected transient Object[] listenerList = NULL_ARRAY;
106
107 /**
108 * Passes back the event listener list as an array
109 * of ListenerType-listener pairs. Note that for
110 * performance reasons, this implementation passes back
111 * the actual data structure in which the listener data
112 * is stored internally!
113 * This method is guaranteed to pass back a non-null
114 * array, so that no null-checking is required in
115 * fire methods. A zero-length array of Object should
116 * be returned if there are currently no listeners.
117 *
118 * WARNING!!! Absolutely NO modification of
119 * the data contained in this array should be made -- if
120 * any such manipulation is necessary, it should be done
121 * on a copy of the array returned rather than the array
122 * itself.
123 *
|