M
- the type of the underlying modelI
- the identifier supplied to the filterprotected abstract static class DefaultRowSorter.ModelWrapper<M,I> extends Object
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 Object
s and String
s. This allows implementations to provide a custom string converter to be used instead of invoking toString
on the object.
RowFilter
, RowFilter.Entry
protected ModelWrapper()
Creates a new ModelWrapper
.
public abstract M getModel()
Returns the underlying model that this Model
is wrapping.
public abstract int getColumnCount()
Returns the number of columns in the model.
public abstract int getRowCount()
Returns the number of rows in the model.
public abstract Object getValueAt(int row, int column)
Returns the value at the specified index.
row
- the row indexcolumn
- the column indexIndexOutOfBoundsException
- if the indices are outside the range of the modelpublic String getStringValueAt(int row, int column)
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.
row
- the row indexcolumn
- the column indexString
IndexOutOfBoundsException
- if the indices are outside the range of the modelpublic abstract I getIdentifier(int row)
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
.
row
- the row to return the identifier for, in terms of the underlying modelRowFilter.Entry.getIdentifier()
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.