Class SortedListModel

java.lang.Object
javax.swing.AbstractListModel
be.gaudry.swing.component.jlist.SortedListModel
All Implemented Interfaces:
IModel, Serializable, ListModel

public class SortedListModel extends AbstractListModel implements IModel
Wrapper class to add sort feature to a listModel Provided by the broldev.core.swing project.
Since:
1.0 (Oct 11, 2008), broldev.core.swing 0.0.1-SNAPSHOT dependency
Version:
1.0 (Oct 11, 2008)
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • SortedListModel

      public SortedListModel()
      Builds a default instance
  • Method Details

    • getSize

      public int getSize()
      Specified by:
      getSize in interface ListModel
    • getElementAt

      public Object getElementAt(int index)
      Specified by:
      getElementAt in interface ListModel
    • addElement

      public void addElement(Object element)
      Adds the specified element to the list
      Specified by:
      addElement in interface IModel
      Parameters:
      element - element to be appended to this list
    • addAll

      public void addAll(Object[] elements)
      Adds all of the elements in the specified array to the list
      Parameters:
      elements - elements to add
    • clear

      public void clear()
      Removes all of the elements from this list The list will be empty after this call returns.
      Specified by:
      clear in interface IModel
    • contains

      public boolean contains(Object element)
      Returns true if this list contains the specified element. More formally, returns true if and only if this list contains at least one element e such that (o==null ? e==null : o.equals(e)).
      Parameters:
      element - element whose presence in this list is to be tested
      Returns:
      true if this list contains the specified element
    • removeElement

      public boolean removeElement(Object element)
      Removes the first occurrence of the specified element from this list, if it is present. If this list does not contain the element, it is unchanged. Returns true if this list contained the specified element (or equivalently, if this list changed as a result of the call).
      Specified by:
      removeElement in interface IModel
      Parameters:
      element - element to be removed from this list, if present
      Returns:
      true if this list contained the specified element