net.mtu.eggplant.util.gui
Class SortedListModel<E>
java.lang.Object
javax.swing.AbstractListModel
net.mtu.eggplant.util.gui.SortedListModel<E>
- Type Parameters:
E
- type of elements in the table model
- All Implemented Interfaces:
- Serializable, ListModel
public class SortedListModel<E>
- extends AbstractListModel
A ListModel that orders the objects according to a comparator and does
sorted insert. The comparator must be able to handle all objects in the
list.
- Version:
- $Revision$
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SortedListModel
public SortedListModel(Comparator<E> comparator)
- Create a SortedListModel with comparator.
- PreConditions
- (comparator != null)
SortedListModel
public SortedListModel(Comparator<E> comparator,
Collection<E> collection)
- Create a SortedListModel with comparator and initalize with the list of
objects in collection.
- PreConditions
- (comparator != null), (collection != null)
getSize
public int getSize()
getElementAt
public E getElementAt(int index)
add
public void add(E o)
- Add o to the list. Sorted insert.
remove
public void remove(E o)
- Remove the first occurrance of o from the list.