APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvm.hotspot.ui.table

public abstract Class TableModelComparator

extends Object
implements Comparator<Object>
Class Inheritance
All Implemented Interfaces
java.util.Comparator
Known Direct Subclasses
sun.jvm.hotspot.ui.ObjectHistogramPanel.ObjectHistogramTableModel.ObjectHistogramComparator, sun.jvm.hotspot.ui.ObjectListPanel.ObjectListTableModel.ObjectListComparator
Imports
java.util.*, javax.swing.table.TableModel, javax.swing.event.TableModelEvent

A comparator which compares rows in a table model

Field Summary

Modifier and TypeField and Description
private boolean
private int[]
protected TableModel

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addColumn(int column)

Add the column to the sort criteria

public int
compare(Object row1, Object row2)

Implements java.util.Comparator.compare.

Implementation of the comparator method.

public int
getColumn()

Get the last column that was sorted

public abstract Comparable<?>
getValueForColumn(Object
Row object that was passed into Comparator.
obj
,
int
the column to retrieve
column
)

Returns the value for the comparing object for the column.

public boolean
public void
setAscending(boolean ascending)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ascendingback to summary
private boolean ascending
columnsback to summary
private int[] columns
modelback to summary
protected TableModel model

Constructor Detail

TableModelComparatorback to summary
public TableModelComparator(TableModel model)

Method Detail

addColumnback to summary
public void addColumn(int column)

Add the column to the sort criteria

compareback to summary
public int compare(Object row1, Object row2)

Implements java.util.Comparator.compare.

Implementation of the comparator method. A comparison is made for rows.

getColumnback to summary
public int getColumn()

Get the last column that was sorted

getValueForColumnback to summary
public abstract Comparable<?> getValueForColumn(Object obj, int column)

Returns the value for the comparing object for the column.

Parameters
obj:Object

Row object that was passed into Comparator.

column:int

the column to retrieve

isAscendingback to summary
public boolean isAscending()
setAscendingback to summary
public void setAscending(boolean ascending)