org.apache.jorphan.gui

## Class ObjectTableModel

- java.lang.Object
- - javax.swing.table.AbstractTableModel
  - - javax.swing.table.DefaultTableModel
    - - org.apache.jorphan.gui.ObjectTableModel

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

      public class ObjectTableModel
      extends javax.swing.table.DefaultTableModel

  The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
  See Also:
    Serialized Form

- - ### Field Summary

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

      `columnIdentifiers, dataVector`

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

      `listenerList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ObjectTableModel(java.lang.String[] headers, java.lang.Class<?> _objClass, Functor[] readFunctors, Functor[] writeFunctors, java.lang.Class<?>[] editorClasses)` The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
    `ObjectTableModel(java.lang.String[] headers, java.lang.Class<?> _objClass, Functor[] readFunctors, Functor[] writeFunctors, java.lang.Class<?>[] editorClasses, boolean cellEditable)` The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
    `ObjectTableModel(java.lang.String[] headers, Functor[] readFunctors, Functor[] writeFunctors, java.lang.Class<?>[] editorClasses)` The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRow(java.lang.Object value)`
    `boolean` | `checkFunctors(java.lang.Object _value, java.lang.Class<?> caller)` Check all registered functors.
    `void` | `clearData()`
    `java.lang.Class<?>` | `getColumnClass(int arg0)`
    `int` | `getColumnCount()`
    `java.lang.String` | `getColumnName(int col)`
    `java.lang.Object` | `getObjectList()`
    `java.util.List<java.lang.Object>` | `getObjectListAsList()`
    `int` | `getRowCount()`
    `java.lang.Object` | `getValueAt(int row, int col)`
    `void` | `insertRow(java.lang.Object value, int index)`
    `boolean` | `isCellEditable(int arg0, int arg1)`
    `java.util.Iterator<?>` | `iterator()`
    `void` | `moveRow(int start, int end, int to)`
    `void` | `removeRow(int row)`
    `void` | `setRows(java.lang.Iterable<?> rows)`
    `void` | `setValueAt(java.lang.Object cellValue, int row, int col)`

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

      `addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, newDataAvailable, newRowsAdded, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount`

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

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

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

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

- - ### Constructor Detail

    - #### ObjectTableModel

          public ObjectTableModel(java.lang.String[] headers,
                                  java.lang.Class<?> _objClass,
                                  Functor[] readFunctors,
                                  Functor[] writeFunctors,
                                  java.lang.Class<?>[] editorClasses)

      The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
      Parameters:
        `headers` - - Column names
        `_objClass` - - Object class that will be used
        `readFunctors` - - used to get the values
        `writeFunctors` - - used to set the values
        `editorClasses` - - class for each column

    - #### ObjectTableModel

          public ObjectTableModel(java.lang.String[] headers,
                                  java.lang.Class<?> _objClass,
                                  Functor[] readFunctors,
                                  Functor[] writeFunctors,
                                  java.lang.Class<?>[] editorClasses,
                                  boolean cellEditable)

      The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
      Parameters:
        `headers` - - Column names
        `_objClass` - - Object class that will be used
        `readFunctors` - - used to get the values
        `writeFunctors` - - used to set the values
        `editorClasses` - - class for each column
        `cellEditable` - - if cell must editable (false to allow double click on cell)

    - #### ObjectTableModel

          public ObjectTableModel(java.lang.String[] headers,
                                  Functor[] readFunctors,
                                  Functor[] writeFunctors,
                                  java.lang.Class<?>[] editorClasses)

      The ObjectTableModel is a TableModel whose rows are objects; columns are defined as Functors on the object.
      Parameters:
        `headers` - - Column names
        `readFunctors` - - used to get the values
        `writeFunctors` - - used to set the values
        `editorClasses` - - class for each column

  - ### Method Detail

    - #### iterator

          public java.util.Iterator<?> iterator()

    - #### clearData

          public void clearData()

    - #### addRow

          public void addRow(java.lang.Object value)

    - #### insertRow

          public void insertRow(java.lang.Object value,
                                int index)

    - #### getColumnCount

          public int getColumnCount()

      Specified by:
        `getColumnCount` in interface `javax.swing.table.TableModel`
      Overrides:
        `getColumnCount` in class `javax.swing.table.DefaultTableModel`

    - #### getColumnName

          public java.lang.String getColumnName(int col)

      Specified by:
        `getColumnName` in interface `javax.swing.table.TableModel`
      Overrides:
        `getColumnName` in class `javax.swing.table.DefaultTableModel`

    - #### getRowCount

          public int getRowCount()

      Specified by:
        `getRowCount` in interface `javax.swing.table.TableModel`
      Overrides:
        `getRowCount` in class `javax.swing.table.DefaultTableModel`

    - #### getValueAt

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

      Specified by:
        `getValueAt` in interface `javax.swing.table.TableModel`
      Overrides:
        `getValueAt` in class `javax.swing.table.DefaultTableModel`

    - #### isCellEditable

          public boolean isCellEditable(int arg0,
                                        int arg1)

      Specified by:
        `isCellEditable` in interface `javax.swing.table.TableModel`
      Overrides:
        `isCellEditable` in class `javax.swing.table.DefaultTableModel`

    - #### moveRow

          public void moveRow(int start,
                              int end,
                              int to)

      Overrides:
        `moveRow` in class `javax.swing.table.DefaultTableModel`

    - #### removeRow

          public void removeRow(int row)

      Overrides:
        `removeRow` in class `javax.swing.table.DefaultTableModel`

    - #### setValueAt

          public void setValueAt(java.lang.Object cellValue,
                                 int row,
                                 int col)

      Specified by:
        `setValueAt` in interface `javax.swing.table.TableModel`
      Overrides:
        `setValueAt` in class `javax.swing.table.DefaultTableModel`

    - #### getColumnClass

          public java.lang.Class<?> getColumnClass(int arg0)

      Specified by:
        `getColumnClass` in interface `javax.swing.table.TableModel`
      Overrides:
        `getColumnClass` in class `javax.swing.table.AbstractTableModel`

    - #### checkFunctors

          public boolean checkFunctors(java.lang.Object _value,
                                       java.lang.Class<?> caller)

      Check all registered functors.

      ** only for use in unit test code **

      Parameters:
        `_value` - - an instance of the table model row data item (if null, use the class passed to the constructor).
        `caller` - - class of caller.
      Returns:
        false if at least one Functor cannot be found.

    - #### getObjectList

          public java.lang.Object getObjectList()

      Returns:
        Object (List of Object)

    - #### getObjectListAsList

          public java.util.List<java.lang.Object> getObjectListAsList()

      Returns:
        List of Object

    - #### setRows

          public void setRows(java.lang.Iterable<?> rows)

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.