|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractListModel
ilog.cpl.list.IlpListModelSorter
public class IlpListModelSorter
This ListModel implementation is used to sort the items
in a list.
It encapsulates the ListModel to be sorted,
as described in the decoration design pattern.
IlpListModelSorter listens to the model it encapsulates and forwards
the model changes to its own listeners according to the sorting
parameters.
| Field Summary |
|---|
| Fields inherited from class javax.swing.AbstractListModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
IlpListModelSorter()
Default constructor. |
|
IlpListModelSorter(ListModel model)
Creates a model sorter using the specified model. |
|
| Method Summary | |
|---|---|
int |
convertRowIndexToModel(int viewRowIndex)
Maps the row in the view located at viewRowIndex to the index
of the row in the list data source. |
int |
convertRowIndexToView(int modelRowIndex)
Maps the row in the list data source located at modelRowIndex
to the index of the row in the view. |
IlpMutableComparator |
getComparator()
Returns the comparator used to sort the underlying model. |
Object |
getElementAt(int index)
Returns the value at the specified index. |
ListModel |
getModel()
Retrieves the list model sorted by the model sorter. |
int |
getSize()
Returns the length of the list. |
void |
setComparator(IlpMutableComparator comparator)
Sets the comparator used to sort the underlying model. |
void |
setModel(ListModel model)
Sets the list model to be sorted by the model sorter. |
String |
toString()
|
| Methods inherited from class javax.swing.AbstractListModel |
|---|
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.swing.ListModel |
|---|
addListDataListener, removeListDataListener |
| Constructor Detail |
|---|
public IlpListModelSorter()
public IlpListModelSorter(ListModel model)
model - The list model this sorter uses.| Method Detail |
|---|
public ListModel getModel()
ListModel encapsulated by the model sorter.public void setModel(ListModel model)
model - The list model to be sorted.public IlpMutableComparator getComparator()
null.setComparator(IlpMutableComparator)public void setComparator(IlpMutableComparator comparator)
comparator - The comparator. May be null. In this case,
the model is not sorted, that is, this model exactly reflects the underlying
model.public int convertRowIndexToModel(int viewRowIndex)
viewRowIndex to the index
of the row in the list data source.
Returns the index of the corresponding row in the list data source.
If viewRowIndex is less than zero, returns
viewRowIndex.
viewRowIndex - The index of the row in the view.
public int convertRowIndexToView(int modelRowIndex)
modelRowIndex
to the index of the row in the view.
Returns the index of the corresponding row in the view; returns -1 if the
row is not displayed.
If modelRowIndex is less than zero, returns
modelRowIndex.
modelRowIndex - The index of the row in the data source.
public int getSize()
getSize in interface ListModelpublic Object getElementAt(int index)
getElementAt in interface ListModelpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||