Class InterDistanceModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--InterDistanceModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
PreviousDistanceModel

public class InterDistanceModel
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
protected  java.lang.Object[][] distance
          The distance matrix in the distance based algorithms
protected  java.lang.String[] names
          The the names of the species
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
InterDistanceModel(FM fm)
          Constructs the data with the FM algorithm.
InterDistanceModel(FM fm, int inRandom_i, int inRandom_j)
          Constructs the data with the FM algorithm.
InterDistanceModel(NJ nj)
          Constructs the data with the NJ algorithm.
InterDistanceModel(NJ nj, int inRandom_i, int inRandom_j)
          Constructs the data with the NJ algorithm.
InterDistanceModel(UPGMA upgma)
          Constructs the data with the UPGMA algorithm.
InterDistanceModel(UPGMA upgma, int inRandom_i, int inRandom_j)
          Constructs the data with the UPGMA 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 getCount()
          Gets the number of the species.
 int getRowCount()
          Overrides the method in the TableModel class and returns the row count of the table.
 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 question cell row and column.
 void updateTable()
          Updates the table so that the value in the row i and the column j equals to the value in the row j and the column i.
 
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
 

Field Detail

distance

protected java.lang.Object[][] distance
The distance matrix in the distance based algorithms


names

protected java.lang.String[] names
The the names of the species

Constructor Detail

InterDistanceModel

public InterDistanceModel(UPGMA upgma,
                          int inRandom_i,
                          int inRandom_j)
Constructs the data with the UPGMA algorithm.

Parameters:
upgma - the UPGMA algorithm
inRandom_i - the row index of the cell for pop up questions in the UPGMA algorithm
inRandom_j - the column index of the cell for pop up questions in the UPGMA algorithm

InterDistanceModel

public InterDistanceModel(UPGMA upgma)
Constructs the data with the UPGMA algorithm.

Parameters:
upgma - the UPGMA algorithm

InterDistanceModel

public InterDistanceModel(NJ nj,
                          int inRandom_i,
                          int inRandom_j)
Constructs the data with the NJ algorithm.

Parameters:
nj - the NJ algorithm
inRandom_i - the row index of the cell for pop up questions in the NJ algorithm
inRandom_j - the column index of the cell for pop up questions in the NJ algorithm

InterDistanceModel

public InterDistanceModel(NJ nj)
Constructs the data with the NJ algorithm.

Parameters:
nj - the NJ algorithm

InterDistanceModel

public InterDistanceModel(FM fm,
                          int inRandom_i,
                          int inRandom_j)
Constructs the data with the FM algorithm.

Parameters:
fm - the FM algorithm
inRandom_i - the row index of the cell for pop up questions in the FM algorithm
inRandom_j - the column index of the cell for pop up questions in the FM algorithm

InterDistanceModel

public InterDistanceModel(FM fm)
Constructs the data with the FM algorithm.

Parameters:
fm - the FM 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

getCount

public int getCount()
Gets the number of the species.

Returns:
the number of the species

updateTable

public void updateTable()
Updates the table so that the value in the row i and the column j equals to the value in the row j and the column i.


update

public void update()
Updates and resets the random question cell row and column.