T
- type of the elements in this list modelpublic class SortableListModel<T> extends AbstractListModel<T>
listenerList
Constructor and Description |
---|
SortableListModel() |
Modifier and Type | Method and Description |
---|---|
void |
add(T value)
Adds a value to the list model.
|
void |
addAll(Collection<T> newData)
Adds all the elements in the collection to the list model.
|
void |
clear()
Clears the list model.
|
void |
fireContentsChanged(Object source,
int index0,
int index1) |
SortedSet<T> |
getData()
Returns the data in this list model ordered.
|
T |
getElementAt(int i) |
int |
getSize() |
boolean |
remove(T value)
Removes a value from the list model.
|
void |
setComparator(Comparator<T> comp)
Sets the comparator to be used to sort the list.
|
addListDataListener, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
public SortableListModel()
public int getSize()
public void setComparator(Comparator<T> comp)
comp
- the comparator.public T getElementAt(int i)
public void add(T value)
value
- the value to be added.public boolean remove(T value)
value
- the value to be removed.true
if the element was on the list and
false
otherwise.public void clear()
public void addAll(Collection<T> newData)
newData
- the collection containing the elements to be added.public void fireContentsChanged(Object source, int index0, int index1)
fireContentsChanged
in class AbstractListModel<T>
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.