org.tfe.console.Tables
Class HotIPTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--org.tfe.console.Tables.HotIPTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class HotIPTableModel
extends javax.swing.table.AbstractTableModel

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
HotIPTableModel()
          Creates new HotIPTableModel
 
Method Summary
 void addRow(java.lang.Object[] HotIPSummary, java.awt.Color rowColor, int hashcode)
          Adds a row to the table.
 void addRows(java.util.ArrayList hotIPs, java.util.ArrayList color, java.util.ArrayList hashcodes)
          Adds rows to the table.
 java.lang.Class getColumnClass(int c)
          Gets the Class type of the data at the specified column.
 int getColumnCount()
          Gets the total number of columns in the table.
 java.lang.String getColumnName(int col)
          Gets the name of a specified column.
 int getHashCode(int rowNum)
          Gets the hashcode associated with a particular row
 java.awt.Color getRowColor(int row)
          Gets the color of the specified row.
 int getRowCount()
          Gets the total number of rows in the table.
 java.lang.Object getValueAt(int row, int col)
          Get the data at a specified cell.
 boolean isCellEditable(int row, int col)
          Whether or not the specified cell is editable.
 void removeAll()
          Removes all rows from the table.
 void removeRow(int index)
          Removes a row from the table.
 void removeRows(int[] rows)
          Removes rows from the table.
 void updateRow(int rowNum, java.lang.Object[] summary, java.awt.Color color)
          Updates the data for a particular row in the HotIPTable.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HotIPTableModel

public HotIPTableModel()
Creates new HotIPTableModel

Method Detail

addRow

public void addRow(java.lang.Object[] HotIPSummary,
                   java.awt.Color rowColor,
                   int hashcode)
Adds a row to the table.

Parameters:
rowColor - the color to make the new row.
hashcode - the hashcode of the HotIP

addRows

public void addRows(java.util.ArrayList hotIPs,
                    java.util.ArrayList color,
                    java.util.ArrayList hashcodes)
Adds rows to the table.

Parameters:
hotIPs - an ArrayList of String arrays containing the values to be added to the table.
color - an ArrayList of Colors to be used for row colorization.
hashcodes - an ArrayList of hashcodes corresponding to the HotIPs being added

updateRow

public void updateRow(int rowNum,
                      java.lang.Object[] summary,
                      java.awt.Color color)
Updates the data for a particular row in the HotIPTable.

Parameters:
rowNum - the row to be updated
summary - the data with which to update the row.

removeRow

public void removeRow(int index)
Removes a row from the table.

Parameters:
index - the index number of the row to be removed from the table.

removeRows

public void removeRows(int[] rows)
Removes rows from the table.


removeAll

public void removeAll()
Removes all rows from the table.


getColumnClass

public java.lang.Class getColumnClass(int c)
Gets the Class type of the data at the specified column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
c - the column for which to retrieve the class type.
Returns:
the Class type of the data at the specified column.

getColumnCount

public int getColumnCount()
Gets the total number of columns in the table.

Returns:
integer value of the number of columns in the table.

getRowCount

public int getRowCount()
Gets the total number of rows in the table.

Returns:
integer value of the number of rows in the table.

getColumnName

public java.lang.String getColumnName(int col)
Gets the name of a specified column.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
col - the column number for which to retrieve the column name.
Returns:
String value of the specified column's name.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the data at a specified cell. This function retrieves the data at the cell specified by the row and column numbers.

Parameters:
row - the row number containing the cell for which to retrieve data.
col - the column number containing the cell for which to retrieve data.
Returns:
an Object representation of the data at the specified cell.

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Whether or not the specified cell is editable.

Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel
Parameters:
row - the row containing the cell of interest.
col - the column number containing the cell of interest.
Returns:
true if the cell is editable, false if it is not.

getRowColor

public java.awt.Color getRowColor(int row)
Gets the color of the specified row.

Parameters:
row - the index of the row for which to retrieve the Color.
Returns:
java.awt.Color value of the row's Color.

getHashCode

public int getHashCode(int rowNum)
Gets the hashcode associated with a particular row

Parameters:
rowNum - the row number of interest
Returns:
int value of the hashcode associated with the HotIP displayed on that row.