public class SortedListModel extends AbstractListModel
| Modifier and Type | Class and Description |
|---|---|
static class |
SortedListModel.SortOrder
DOCUMENT ME!
|
listenerList| Constructor and Description |
|---|
SortedListModel(ListModel model)
Create a SortedListModel from an existing model using a default text comparator for the default Locale.
|
SortedListModel(ListModel model,
SortedListModel.SortOrder sortOrder)
Create a SortedListModel from an existing model using a specific comparator and sort order.
|
SortedListModel(ListModel model,
SortedListModel.SortOrder sortOrder,
Comparator comp)
Create a SortedListModel from an existing model.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getElementAt(int index)
Retrieve the sorted entry from the original model.
|
int |
getSize()
Retrieve the size of the underlying model.
|
void |
setComparator(Comparator comp)
DOCUMENT ME!
|
void |
setSortOrder(SortedListModel.SortOrder sortOrder)
Change the sort order of the model at runtime.
|
int |
toSortedModelIndex(int unsortedIndex)
Convert an unsorted model index to a sorted model index.
|
int[] |
toSortedModelIndices(int[] unsortedModelIndices)
Convert an array of unsorted model selection indices to indices in the sorted model.
|
int |
toUnsortedModelIndex(int index)
Convert sorted model index to an unsorted model index.
|
int[] |
toUnsortedModelIndices(int[] sortedSelectedIndices)
Convert an array of sorted model indices to their unsorted model indices.
|
void |
unsortedContentsChanged()
Resort the sorted model if there are changes in the original unsorted model.
|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerpublic SortedListModel(ListModel model)
model - the underlying, unsorted ListModelpublic SortedListModel(ListModel model, SortedListModel.SortOrder sortOrder)
model - the unsorted list modelsortOrder - that should be usedpublic SortedListModel(ListModel model, SortedListModel.SortOrder sortOrder, Comparator comp)
model - DOCUMENT ME!sortOrder - DOCUMENT ME!comp - DOCUMENT ME!public Object getElementAt(int index) throws IndexOutOfBoundsException
index - index of an entry in the sorted modelIndexOutOfBoundsException - DOCUMENT ME!public int getSize()
public int toUnsortedModelIndex(int index)
throws IndexOutOfBoundsException
index - an index in the sorted modelIndexOutOfBoundsException - DOCUMENT ME!public int[] toUnsortedModelIndices(int[] sortedSelectedIndices)
sortedSelectedIndices - indices of selected elements in the sorted model or sorted viewpublic int toSortedModelIndex(int unsortedIndex)
unsortedIndex - an element index in the unsorted modelpublic int[] toSortedModelIndices(int[] unsortedModelIndices)
unsortedModelIndices - DOCUMENT ME!public void setComparator(Comparator comp)
comp - DOCUMENT ME!public void setSortOrder(SortedListModel.SortOrder sortOrder)
sortOrder - DOCUMENT ME!public void unsortedContentsChanged()
Copyright © 2012–2026 cismet GmbH. All rights reserved.