protected abstract static class javax.swing
DefaultRowSorter.ModelWrapper<M, I>


Show All Login
Java SE 6
  
Contained within: DefaultRowSorter
Details
DefaultRowSorter.ModelWrapper is responsible for providing the data that gets sorted by DefaultRowSorter. You normally do not interact directly with ModelWrapper. Subclasses of DefaultRowSorter provide an implementation of ModelWrapper wrapping another model. For example, TableRowSorter provides a ModelWrapper that wraps a TableModel.

ModelWrapper makes a distinction between values as Objects and Strings. This allows implementations to provide a custom string converter to be used instead of invoking toString on the object.
Mthe type of the underlying model
Ithe identifier supplied to the filter
since1.6
See also javax.swing.RowFilter, javax.swing.RowFilter.Entry


Constructors
protected DefaultRowSorter.ModelWrapper()
Creates a new ModelWrapper.

Properties
abstract public int getColumnCount() Details
Returns the number of columns in the model.
returnthe number of columns in the model
abstract public Object getIdentifier(int row) Details
Returns the identifier for the specified row. The return value of this is used as the identifier for the RowFilter.Entry that is passed to the RowFilter.
rowthe row to return the identifier for, in terms of the underlying model
returnthe identifier
See also getIdentifier
abstract public Object getModel() Details
Returns the underlying model that this Model is wrapping.
returnthe underlying model
abstract public int getRowCount() Details
Returns the number of rows in the model.
returnthe number of rows in the model
public String getStringValueAt(int row, int column) Details
Returns the value as a String at the specified index. This implementation uses toString on the result from getValueAt (making sure to return an empty string for null values). Subclasses that override this method should never return null.
rowthe row index
columnthe column index
returnthe value at the specified index as a String
ThrowsIndexOutOfBoundsException: if the indices are outside the range of the model
abstract public Object getValueAt(int row, int column) Details
Returns the value at the specified index.
rowthe row index
columnthe column index
returnthe value at the specified index
ThrowsIndexOutOfBoundsException: if the indices are outside the range of the model