HiRISE

HiRISE.HiPlan.Data_Slacker
Class SsrDrainTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by HiRISE.HiPlan.Data_Slacker.SsrDrainTableModel
All Implemented Interfaces:
Serializable, TableModel

public class SsrDrainTableModel
extends AbstractTableModel

A table model for SSR drain records. The model includes an enumeration of its columns.

Version:
1.2
Author:
Christian Schaller - UA/PIRL
See Also:
SsrDrain, Serialized Form

Nested Class Summary
static class SsrDrainTableModel.Column
          An enumeration of the table model's columns.
 
Field Summary
static String ID
          Class identification name with source code version and date.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
SsrDrainTableModel()
          Creates a new SSR drain table model with an empty list of SSR drains.
SsrDrainTableModel(List<SsrDrain> records)
          Creates a new SSR drain table model from a list of SSR drains.
 
Method Summary
 Class getColumnClass(int col)
          Gets the class of the indicated column.
 int getColumnCount()
          Gets the total number of columns in this table model.
 String getColumnName(int col)
          Gets the name of the indicated column.
 SsrDrain getRecord(int row)
          Gets the data record for the indicated model row.
 List<SsrDrain> getRecords()
          Gets a copy of this table model's SSR drain records.
 int getRowCount()
          Gets the total number of rows in this table model.
 Object getValueAt(int row, int col)
          Gets the value for the cell at the indicated row and column.
 void setRecords(List<SsrDrain> records)
          Replaces this table model's current list of records with a new list.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, 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

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values
Constructor Detail

SsrDrainTableModel

public SsrDrainTableModel(List<SsrDrain> records)
Creates a new SSR drain table model from a list of SSR drains. Upon construction, its fireTableDataChanged() method is invoked.

The list of records may be null, in which case the model is empty.

Parameters:
records - the list of SSR drain records for the new table model; may be null.

SsrDrainTableModel

public SsrDrainTableModel()
Creates a new SSR drain table model with an empty list of SSR drains. Upon construction, its fireTableDataChanged() method is invoked.

Method Detail

setRecords

public void setRecords(List<SsrDrain> records)
Replaces this table model's current list of records with a new list. The new list may be null or empty; the current list will then simply be removed.

This method invokes the model's fireTableDataChanged() method.

Parameters:
records - the new list of SSR drains; may be null.

getRecords

public List<SsrDrain> getRecords()
Gets a copy of this table model's SSR drain records. The list may be empty, but it will not be null.

Returns:
a copy of this table model's SSR drains.

getRowCount

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

Returns:
the total number of rows in this table model.

getColumnCount

public int getColumnCount()
Gets the total number of columns in this table model. This value is equal to the number of members of the SsrDrainTableModel.Column enumeration.

Returns:
the total number of columns in this table model.

getValueAt

public Object getValueAt(int row,
                         int col)
Gets the value for the cell at the indicated row and column. The class of the object returned may be obtained from the getColumnClass(int) method.

Parameters:
row - the table model row index.
col - the table model column index.
Returns:
the value object at the specified cell.

getColumnClass

public Class getColumnClass(int col)
Gets the class of the indicated column.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
Parameters:
col - the table model column index.
Returns:
the class of the column.

getColumnName

public String getColumnName(int col)
Gets the name of the indicated column.

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

getRecord

public SsrDrain getRecord(int row)
Gets the data record for the indicated model row.

Parameters:
row - the model row.
Returns:
the data record.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona