org.freehep.swing.table
Interface SortableTableModel

All Superinterfaces:
TableModel
All Known Implementing Classes:
DefaultSortableTableModel

public interface SortableTableModel
extends TableModel

An interface to be implemented by table models which are sortable.

Version:
$Id: SortableTableModel.java 10766 2007-06-02 17:29:04Z tonyj $
Author:
Tony Johnson
See Also:
TableSorter

Field Summary
static int UNSORTED
           
 
Method Summary
 int getSortOnColumn()
          Returns the sort column, or UNSORTED if no sort currently in effect.
 boolean isSortAscending()
           
 void sort(int column, boolean ascending)
          Sort the table model using the given column.
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Field Detail

UNSORTED

static final int UNSORTED
See Also:
Constant Field Values
Method Detail

sort

void sort(int column,
          boolean ascending)
Sort the table model using the given column. Once this method has been called the table model should reorder its rows so that they are sorted using the given column. The table model should generate appropriate change events to reflect any changes made to the model as a result of the sort. If the table data is modified after sort has been called, the table model should continue to sort the data using the given column.

Parameters:
column - The index of the column to sort on, or UNSORTED if no sort is necessary.
ascending - If true sort in ascending order, else sort in descending order.

isSortAscending

boolean isSortAscending()

getSortOnColumn

int getSortOnColumn()
Returns the sort column, or UNSORTED if no sort currently in effect.



Copyright © 2000-2007 FreeHEP. All Rights Reserved.