Package moss
Class MoSSTable
java.lang.Object
javax.swing.table.AbstractTableModel
moss.MoSSTable
- All Implemented Interfaces:
Serializable
,TableModel
Class for data tables for molecular substructure mining.
This data table class is implemented as a subclass of
AbstractTableModel
so that it can be displayed
directly in a JTable
.
- Since:
- 2007.02.15
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
mode: graphsstatic final int
mode: identifiersstatic final int
mode: substructuresFields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the number of columns of the data table.getColumnName
(int col) Get the name of a column given its index.int
Get the number of rows of the table.getValueAt
(int row, int col) Get the value of a table cell as an object.boolean
isCellEditable
(int row, int col) Returns whether a table cell is editable.void
Read table from an input stream.void
setValueAt
(Object value, int row, int col) Set the value of a table cell from an object.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
-
Field Details
-
GRAPHS
public static final int GRAPHSmode: graphs- See Also:
-
SUBS
public static final int SUBSmode: substructures- See Also:
-
IDS
public static final int IDSmode: identifiers- See Also:
-
-
Constructor Details
-
MoSSTable
Create a data table.- Parameters:
mode
- the table modeformat
- the format of the input- Since:
- 2007.02.15 (Christian Borgelt)
-
-
Method Details
-
getRowCount
public int getRowCount()Get the number of rows of the table.- Specified by:
getRowCount
in interfaceTableModel
- Returns:
- the number of rows of the table
- Since:
- 2007.02.15 (Christian Borgelt)
-
getColumnCount
public int getColumnCount()Get the number of columns of the data table.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns of the data table
- Since:
- 2007.02.15 (Christian Borgelt)
-
getColumnName
Get the name of a column given its index.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
col
- the index of the column- Returns:
- the name of the column with the given index
- Since:
- 2007.02.15 (Christian Borgelt)
-
isCellEditable
public boolean isCellEditable(int row, int col) Returns whether a table cell is editable.Editing is currently not supported.
- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
- Parameters:
row
- the row of the cell to access; must be in the range 0 togetRowCount()-1
col
- the column of the cell to access; must be in the range 0 togetColumnCount()-1
- Returns:
- whether the specified cell is editable
- Since:
- 2007.02.15 (Christian Borgelt)
-
getValueAt
Get the value of a table cell as an object.- Specified by:
getValueAt
in interfaceTableModel
- Parameters:
row
- the row of the cell to access; must be in the range 0 togetRowCount()-1
col
- the column of the cell to access; must be in the range 0 togetColumnCount()-1
- Returns:
- an object representing the value in the specified cell
- Since:
- 2007.02.15 (Christian Borgelt)
-
setValueAt
Set the value of a table cell from an object.- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
- Parameters:
value
- the value to set in the specified cellrow
- the row of the cell to set; must be in the range 0 togetRowCount()-1
col
- the column of the cell to set; must be in the range 0 togetColumnCount()-1
- Since:
- 2007.02.15 (Christian Borgelt)
-
read
Read table from an input stream.- Parameters:
file
- the file to read from- Throws:
IOException
- if reading the file failed- Since:
- 2007.02.08 (Christian Borgelt)
-