weka.gui.ensembleLibraryEditor
Class ModelList.SortedListModel
java.lang.Object
javax.swing.AbstractListModel
weka.gui.ensembleLibraryEditor.ModelList.SortedListModel
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.ListModel
- Enclosing class:
- ModelList
public class ModelList.SortedListModel
- extends javax.swing.AbstractListModel
This is a helper class that creates a custom list model for the ModelList class.
It basically ensures that all model entries are 1) unique - so that no duplicate
entries can find their way in, and 2) sorted alphabetically. It also numbers
them.
This nested class was adapted from code found in a freely available tutorial on
sorting JList entries by John Zukowski - wait a sec, he's the guy who wrote the
other tutorial I cited in the AddModelsPanel. wow, different web site even.
This guy is really in to writing tutorials. Anyway, it was very helpful, if
you would like to know more about implementing swing MVC stuff.
Anyway, John Zukowski's tutorial can be found at:
http://www.jguru.com/faq/view.jsp?EID=15245
- See Also:
- Serialized Form
Methods inherited from class javax.swing.AbstractListModel |
addListDataListener, getListDataListeners, getListeners, removeListDataListener |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ModelList.SortedListModel
public ModelList.SortedListModel()
- default constructor
getSize
public int getSize()
getElementAt
public java.lang.Object getElementAt(int index)
add
public void add(java.lang.Object element)
addAll
public void addAll(java.lang.Object[] elements)
clear
public void clear()
contains
public boolean contains(java.lang.Object element)
firstElement
public java.lang.Object firstElement()
iterator
public java.util.Iterator iterator()
lastElement
public java.lang.Object lastElement()
removeElement
public boolean removeElement(java.lang.Object element)