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>
A sorted
ListModel
which stores only unique entries.- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractListModel
listenerList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified item to this list model.void
addAll
(Collection<? extends T> collection) Adds all items contained in this collection to this list model.void
clear()
Clears this list model.getElementAt
(int index) int
getIndexOf
(T item) Returns the index of the specified item in this list model.int
getSize()
void
Removes the specified item from this list model.Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
-
Constructor Details
-
SortedListModel
public SortedListModel()Constructs a new sorted list model.
-
-
Method Details
-
remove
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
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
Adds all items contained in this collection to this list model. This method is implemented by invokingadd(Comparable)
.- Parameters:
collection
- the collection of items to add to this list model
-
getIndexOf
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
-