< prev index next >

src/java.desktop/share/classes/javax/swing/ListModel.java

Print this page




  35  * length of the data model must be reported to all of the
  36  * ListDataListeners.
  37  *
  38  * @param <E> the type of the elements of this model
  39  *
  40  * @author Hans Muller
  41  * @see JList
  42  * @since 1.2
  43  */
  44 public interface ListModel<E>
  45 {
  46   /**
  47    * Returns the length of the list.
  48    * @return the length of the list
  49    */
  50   int getSize();
  51 
  52   /**
  53    * Returns the value at the specified index.
  54    * @param index the requested index
  55    * @return the value at <code>index</code>
  56    */
  57   E getElementAt(int index);
  58 
  59   /**
  60    * Adds a listener to the list that's notified each time a change
  61    * to the data model occurs.
  62    * @param l the <code>ListDataListener</code> to be added
  63    */
  64   void addListDataListener(ListDataListener l);
  65 
  66   /**
  67    * Removes a listener from the list that's notified each time a
  68    * change to the data model occurs.
  69    * @param l the <code>ListDataListener</code> to be removed
  70    */
  71   void removeListDataListener(ListDataListener l);
  72 }


  35  * length of the data model must be reported to all of the
  36  * ListDataListeners.
  37  *
  38  * @param <E> the type of the elements of this model
  39  *
  40  * @author Hans Muller
  41  * @see JList
  42  * @since 1.2
  43  */
  44 public interface ListModel<E>
  45 {
  46   /**
  47    * Returns the length of the list.
  48    * @return the length of the list
  49    */
  50   int getSize();
  51 
  52   /**
  53    * Returns the value at the specified index.
  54    * @param index the requested index
  55    * @return the value at {@code index}
  56    */
  57   E getElementAt(int index);
  58 
  59   /**
  60    * Adds a listener to the list that's notified each time a change
  61    * to the data model occurs.
  62    * @param l the {@code ListDataListener} to be added
  63    */
  64   void addListDataListener(ListDataListener l);
  65 
  66   /**
  67    * Removes a listener from the list that's notified each time a
  68    * change to the data model occurs.
  69    * @param l the {@code ListDataListener} to be removed
  70    */
  71   void removeListDataListener(ListDataListener l);
  72 }
< prev index next >