Package fim

Class PatternTable

All Implemented Interfaces:
Serializable, TableModel

public class PatternTable extends AbstractTableModel implements Serializable
Class for a tabular representation of a set of item patterns.
Since:
2013.11.28
See Also:
  • Field Details

    • pats

      protected PatternSet pats
      the set of item patterns
    • cnt

      protected int cnt
      the maximum number of items in a pattern
    • names

      protected String[] names
      the names of the table columns
  • Constructor Details

    • PatternTable

      public PatternTable(PatternSet pats)
      Create an item pattern table.
      Parameters:
      pats - the set of item patterns
      Since:
      2013.11.28 (Christian Borgelt)
  • Method Details

    • getPatterns

      public PatternSet getPatterns()
      Get the item patterns.
      Returns:
      the item pattern set
      Since:
      2013.11.28 (Christian Borgelt)
    • setPatterns

      public void setPatterns(PatternSet pats)
      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 interface TableModel
      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 interface TableModel
      Returns:
      the number of columns of the table
      Since:
      2013.11.28 (Christian Borgelt)
    • getColumnName

      public String getColumnName(int i)
      Get the name of a column.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
      Parameters:
      i - the index of the column
      Returns:
      the name of the column with index i
      Since:
      2013.11.28 (Christian Borgelt)
    • getValueAt

      public Object getValueAt(int row, int col)
      Get the value in a table cell.
      Specified by:
      getValueAt in interface TableModel
      Parameters:
      row - the row index of the table cell
      col - the column index of the table cell
      Returns:
      an object representing the contents of the table cell
      Since:
      2013.11.28 (Christian Borgelt)
    • main

      public static void main(String[] args)
      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)