Class InterCharacterModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--InterCharacterModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class InterCharacterModel
extends javax.swing.table.AbstractTableModel

This class is used to set the intermediate result table data in the MP algorithm

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
InterCharacterModel(MP mp)
          Constructs the data with the MP algorithm.
InterCharacterModel(MP mp, int inRandom_site)
          Constructs the data with the MP algorithm.
 
Method Summary
 int getColumnCount()
          Overrides the method in the TableModel class and returns the column count of the table.
 java.lang.String getColumnName(int columnIndex)
          Overrides the method in the TableModel class and returns the column names of the table.
 int getRowCount()
          Overrides the method in the TableModel class and returns the row count of the table.
 int getTotal()
          Gets the total number of substitutions in the MP algorithm.
 java.lang.Object getValueAt(int row, int col)
          Overrides the method in the TableModel class and returns the value of each table cell.
 void update()
          Updates and resets the random site number.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterCharacterModel

public InterCharacterModel(MP mp,
                           int inRandom_site)
Constructs the data with the MP algorithm.

Parameters:
mp - the MP algorithm
inRandom_site - - the random site number for pop up questions in the MP algorithm

InterCharacterModel

public InterCharacterModel(MP mp)
Constructs the data with the MP algorithm.

Parameters:
mp - the MP algorithm
Method Detail

getRowCount

public int getRowCount()
Overrides the method in the TableModel class and returns the row count of the table.

Returns:
the row count of the table

getColumnCount

public int getColumnCount()
Overrides the method in the TableModel class and returns the column count of the table.

Returns:
the column count of the table

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Overrides the method in the TableModel class and returns the value of each table cell.

Parameters:
row - the row whose value is to be queried
col - the column whose value is to be queried
Returns:
the value Object at the specified cell

getColumnName

public java.lang.String getColumnName(int columnIndex)
Overrides the method in the TableModel class and returns the column names of the table.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - the index of the column
Returns:
the name of the column

getTotal

public int getTotal()
Gets the total number of substitutions in the MP algorithm.

Returns:
the total number of substitutions in the MP algorithm

update

public void update()
Updates and resets the random site number.