Class SortedListModel<T extends Comparable<T>>

java.lang.Object
javax.swing.AbstractListModel<T>
org.moeaframework.analysis.diagnostics.SortedListModel<T>
Type Parameters:
T - the type of entry stored in this list model
All Implemented Interfaces:
Serializable, ListModel<T>

public class SortedListModel<T extends Comparable<T>> extends AbstractListModel<T>
A sorted ListModel which stores only unique entries.
See Also:
  • Constructor Details

    • SortedListModel

      public SortedListModel()
      Constructs a new sorted list model.
  • Method Details

    • remove

      public void remove(T item)
      Removes the specified item from this list model.
      Parameters:
      item - the item to remove from this list model
    • clear

      public void clear()
      Clears this list model.
    • add

      public void add(T item)
      Adds the specified item to this list model. If the item already exists, the list model is unchanged.
      Parameters:
      item - the item to add to this list model
    • addAll

      public void addAll(Collection<? extends T> collection)
      Adds all items contained in this collection to this list model. This method is implemented by invoking add(Comparable).
      Parameters:
      collection - the collection of items to add to this list model
    • getIndexOf

      public int getIndexOf(T item)
      Returns the index of the specified item in this list model.
      Parameters:
      item - the item whose index is returned
      Returns:
      the index of the specified item in this list model
    • getSize

      public int getSize()
    • getElementAt

      public T getElementAt(int index)