com.pixelmed.database

## Class MapTableModel

- java.lang.Object
- - javax.swing.table.AbstractTableModel
  - - com.pixelmed.database.MapTableModel

- All Implemented Interfaces:
    java.io.Serializable, javax.swing.table.TableModel

      public class MapTableModel
      extends javax.swing.table.AbstractTableModel

  The `MapTableModel` class extends a `AbstractTableModel` to abstract the contents of a database as a tree in order to provide support for a `MapTableBrowser`.

  For details of some of the methods implemented here see `javax.swing.table.AbstractTableModel`.

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected int` | `columnCount`
    `protected java.lang.String[]` | `columnNames`
    `protected java.lang.Object[][]` | `data`
    `protected java.util.HashSet` | `excludeList`
    `protected java.util.HashSet` | `includeList`
    `protected int` | `rowCount`

    - ### Fields inherited from class javax.swing.table.AbstractTableModel

      `listenerList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapTableModel()` Construct an empty single row table model.
    `MapTableModel(java.util.Map map, java.util.Map descriptiveNameMap)` Construct a single row table model filled with the supplied attributes and values.
    `MapTableModel(java.util.Map map, java.util.Map descriptiveNameMap, java.util.HashSet includeList, java.util.HashSet excludeList)` Construct a single row table model filled with the supplied attributes and values.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getColumnCount()`
    `java.lang.String` | `getColumnName(int col)`
    `int` | `getRowCount()`
    `java.lang.Object` | `getValueAt(int row, int col)`
    `void` | `initializeModelFromMap(java.util.Map map, java.util.Map descriptiveNameMap)` Initialize a single row table model filled with the supplied attributes and values.
    `protected boolean` | `isAcceptable(java.util.HashSet includeList, java.util.HashSet excludeList, java.lang.String name)` Check whether or not the named attribute is acceptable for inclusion as a column in the table.
    `boolean` | `isCellEditable(int row, int col)`

    - ### Methods inherited from class javax.swing.table.AbstractTableModel

      `addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### columnCount

          protected int columnCount

    - #### rowCount

          protected int rowCount

    - #### columnNames

          protected java.lang.String[] columnNames

    - #### data

          protected java.lang.Object[][] data

    - #### includeList

          protected java.util.HashSet includeList

    - #### excludeList

          protected java.util.HashSet excludeList

  - ### Constructor Detail

    - #### MapTableModel

          public MapTableModel()

      Construct an empty single row table model.

    - #### MapTableModel

          public MapTableModel(java.util.Map map,
                               java.util.Map descriptiveNameMap)

      Construct a single row table model filled with the supplied attributes and values.

      Parameters:
        `map` - a map of string names for attributes to their string values
        `descriptiveNameMap` - a map of string names for attributes to descriptions for use as column titles (may be null)

    - #### MapTableModel

          public MapTableModel(java.util.Map map,
                               java.util.Map descriptiveNameMap,
                               java.util.HashSet includeList,
                               java.util.HashSet excludeList)

      Construct a single row table model filled with the supplied attributes and values.

      Parameters:
        `map` - a map of string names for attributes to their string values
        `descriptiveNameMap` - a map of string names for attributes to descriptions for use as column titles (may be null)
        `includeList` - a set of upper case string names for suitable attributes (may be null)
        `excludeList` - a set of upper case string names for unsuitable attributes (may be null)

  - ### Method Detail

    - #### isAcceptable

          protected boolean isAcceptable(java.util.HashSet includeList,
                                         java.util.HashSet excludeList,
                                         java.lang.String name)

      Check whether or not the named attribute is acceptable for inclusion as a column in the table.

      Parameters:
        `includeList` - a set of upper case string names for suitable attributes (currently ignored)
        `excludeList` - a set of upper case string names for unsuitable attributes
        `name` - the name of the attribute to be checked (case insensitive)
      Returns:
        true if the attribute is acceptable

    - #### initializeModelFromMap

          public void initializeModelFromMap(java.util.Map map,
                                             java.util.Map descriptiveNameMap)

      Initialize a single row table model filled with the supplied attributes and values.

      Parameters:
        `map` - a map of string names for attributes to their string values
        `descriptiveNameMap` - a map of string names for attributes to descriptions for use as column titles (may be null)

    - #### getColumnCount

          public int getColumnCount()

    - #### getRowCount

          public int getRowCount()

    - #### getValueAt

          public java.lang.Object getValueAt(int row,
                                             int col)

      Parameters:
        `row` -
        `col` -

    - #### isCellEditable

          public boolean isCellEditable(int row,
                                        int col)

      Specified by:
        `isCellEditable` in interface `javax.swing.table.TableModel`
      Overrides:
        `isCellEditable` in class `javax.swing.table.AbstractTableModel`
      Parameters:
        `row` -
        `col` -

    - #### getColumnName

          public java.lang.String getColumnName(int col)

      Specified by:
        `getColumnName` in interface `javax.swing.table.TableModel`
      Overrides:
        `getColumnName` in class `javax.swing.table.AbstractTableModel`
      Parameters:
        `col` -