Class SortableListModelImpl<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    java.io.Serializable, javax.swing.ListModel<T>, MutableListModel<T>, SortableListModel<T>

    public final class SortableListModelImpl<T>
    extends javax.swing.AbstractListModel<T>
    implements SortableListModel<T>
    Provides a sorted ListModel based on an ArrayList for use with a JList.
    Author:
    F. Mannhardt
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.AbstractListModel

        listenerList
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(T element)  
      boolean addAll​(java.lang.Iterable<T> elements)  
      void clear()  
      T getElementAt​(int index)  
      int getSize()  
      void sort​(java.util.Comparator<T> comparator)  
      • Methods inherited from class javax.swing.AbstractListModel

        addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.ListModel

        addListDataListener, removeListDataListener
    • Constructor Detail

      • SortableListModelImpl

        public SortableListModelImpl()
      • SortableListModelImpl

        public SortableListModelImpl​(java.util.Collection<T> traces)
    • Method Detail

      • getSize

        public int getSize()
        Specified by:
        getSize in interface javax.swing.ListModel<T>
      • getElementAt

        public T getElementAt​(int index)
        Specified by:
        getElementAt in interface javax.swing.ListModel<T>
      • addAll

        public boolean addAll​(java.lang.Iterable<T> elements)
        Specified by:
        addAll in interface MutableListModel<T>
      • sort

        public void sort​(java.util.Comparator<T> comparator)
        Specified by:
        sort in interface SortableListModel<T>