Package fim
Class PatternTable
java.lang.Object
javax.swing.table.AbstractTableModel
fim.PatternTable
- All Implemented Interfaces:
Serializable
,TableModel
Class for a tabular representation of a set of item patterns.
- Since:
- 2013.11.28
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
the maximum number of items in a patternprotected String[]
the names of the table columnsprotected PatternSet
the set of item patternsFields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Get the number of columns of the table.getColumnName
(int i) Get the name of a column.Get the item patterns.int
Get the number of rows of the table.getValueAt
(int row, int col) Get the value in a table cell.static void
Main function for testing some basic functionality.void
setPatterns
(PatternSet pats) Set the item patterns.void
sort
(int field) Sort the set of item patterns.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Field Details
-
pats
the set of item patterns -
cnt
protected int cntthe maximum number of items in a pattern -
names
the names of the table columns
-
-
Constructor Details
-
PatternTable
Create an item pattern table.- Parameters:
pats
- the set of item patterns- Since:
- 2013.11.28 (Christian Borgelt)
-
-
Method Details
-
getPatterns
Get the item patterns.- Returns:
- the item pattern set
- Since:
- 2013.11.28 (Christian Borgelt)
-
setPatterns
Set the item patterns.- Parameters:
pats
- the new pattern set- Since:
- 2013.11.28 (Christian Borgelt)
-
sort
public void sort(int field) Sort the set of item patterns.- Parameters:
field
- the identifier of the field to compare first- Since:
- 2014.10.05 (Christian Borgelt)
-
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:
- 2013.11.28 (Christian Borgelt)
-
getColumnCount
public int getColumnCount()Get the number of columns of the table.- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- the number of columns of the table
- Since:
- 2013.11.28 (Christian Borgelt)
-
getColumnName
Get the name of a column.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
- Parameters:
i
- the index of the column- Returns:
- the name of the column with index i
- Since:
- 2013.11.28 (Christian Borgelt)
-
getValueAt
Get the value in a table cell.- Specified by:
getValueAt
in interfaceTableModel
- Parameters:
row
- the row index of the table cellcol
- the column index of the table cell- Returns:
- an object representing the contents of the table cell
- Since:
- 2013.11.28 (Christian Borgelt)
-
main
Main function for testing some basic functionality.It is tried to parse the file that is given as the first command line argument as a set of patterns.
- Parameters:
args
- the command line arguments- Since:
- 2013.11.28 (Christian Borgelt)
-