< prev index next >

src/share/classes/javax/swing/AbstractListModel.java

Print this page
rev 1527 : 6727662: Code improvement and warnings removing from swing packages
Summary: Removed unnecessary castings and other warnings
Reviewed-by: malenkov


  68      */
  69     public void removeListDataListener(ListDataListener l) {
  70         listenerList.remove(ListDataListener.class, l);
  71     }
  72 
  73 
  74     /**
  75      * Returns an array of all the list data listeners
  76      * registered on this <code>AbstractListModel</code>.
  77      *
  78      * @return all of this model's <code>ListDataListener</code>s,
  79      *         or an empty array if no list data listeners
  80      *         are currently registered
  81      *
  82      * @see #addListDataListener
  83      * @see #removeListDataListener
  84      *
  85      * @since 1.4
  86      */
  87     public ListDataListener[] getListDataListeners() {
  88         return (ListDataListener[])listenerList.getListeners(
  89                 ListDataListener.class);
  90     }
  91 
  92 
  93     /**
  94      * <code>AbstractListModel</code> subclasses must call this method
  95      * <b>after</b>
  96      * one or more elements of the list change.  The changed elements
  97      * are specified by the closed interval index0, index1 -- the endpoints
  98      * are included.  Note that
  99      * index0 need not be less than or equal to index1.
 100      *
 101      * @param source the <code>ListModel</code> that changed, typically "this"
 102      * @param index0 one end of the new interval
 103      * @param index1 the other end of the new interval
 104      * @see EventListenerList
 105      * @see DefaultListModel
 106      */
 107     protected void fireContentsChanged(Object source, int index0, int index1)
 108     {
 109         Object[] listeners = listenerList.getListenerList();




  68      */
  69     public void removeListDataListener(ListDataListener l) {
  70         listenerList.remove(ListDataListener.class, l);
  71     }
  72 
  73 
  74     /**
  75      * Returns an array of all the list data listeners
  76      * registered on this <code>AbstractListModel</code>.
  77      *
  78      * @return all of this model's <code>ListDataListener</code>s,
  79      *         or an empty array if no list data listeners
  80      *         are currently registered
  81      *
  82      * @see #addListDataListener
  83      * @see #removeListDataListener
  84      *
  85      * @since 1.4
  86      */
  87     public ListDataListener[] getListDataListeners() {
  88         return listenerList.getListeners(ListDataListener.class);

  89     }
  90 
  91 
  92     /**
  93      * <code>AbstractListModel</code> subclasses must call this method
  94      * <b>after</b>
  95      * one or more elements of the list change.  The changed elements
  96      * are specified by the closed interval index0, index1 -- the endpoints
  97      * are included.  Note that
  98      * index0 need not be less than or equal to index1.
  99      *
 100      * @param source the <code>ListModel</code> that changed, typically "this"
 101      * @param index0 one end of the new interval
 102      * @param index1 the other end of the new interval
 103      * @see EventListenerList
 104      * @see DefaultListModel
 105      */
 106     protected void fireContentsChanged(Object source, int index0, int index1)
 107     {
 108         Object[] listeners = listenerList.getListenerList();


< prev index next >