Interface RowObjectTableModel<T>

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void fireTableDataChanged()
      Sends an event to all listeners that all the data inside of this model may have changed.
      java.lang.Object getColumnValueForRow​(T t, int columnIndex)
      Implementors are expected to return a value at the given column index for the specified row object.
      java.util.List<T> getModelData()
      Implementors should return the current data of the model.
      java.lang.String getName()
      Returns the name of this model
      int getRowIndex​(T t)
      Returns the row number for the given object.
      T getRowObject​(int viewRow)
      Returns the row object for the given row.
      static javax.swing.table.TableModel unwrap​(javax.swing.table.TableModel m)  
      • Methods inherited from interface javax.swing.table.TableModel

        addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
    • Method Detail

      • unwrap

        static javax.swing.table.TableModel unwrap​(javax.swing.table.TableModel m)
      • getName

        java.lang.String getName()
        Returns the name of this model
        Returns:
        the name of this model
      • getRowObject

        T getRowObject​(int viewRow)
        Returns the row object for the given row. This is the row in the UI. For models that know how to filter, the model row value will not match the view row value. For non-filtering models the view and model rows will always be the same.
        Parameters:
        viewRow - the row for which to return a row object.
        Returns:
        the row object
      • getRowIndex

        int getRowIndex​(T t)
        Returns the row number for the given object.

        Note: the index returned is always the 'view' index. For non-filtering table models, the 'view' and the 'model' index are the same. However, for filtering table models, the 'view' may be a subset of the 'model' index. Thus, it is possible, if this model is a filtering model, that the given t may not have a row value for the current state of the model (i.e., when the model is filtered in the view. If you really need to get the model index in such a situation, see RowObjectFilterModel.

        Parameters:
        t - the object
        Returns:
        the row number
      • getModelData

        java.util.List<T> getModelData()
        Implementors should return the current data of the model. For models that support filtering, this will be the filtered version of the data. Furthermore, the data should be the underlying data and not a copy, as this method will potentially sort the given data.

        For those subclasses using an array, you may use the Arrays class to create a list backed by the array (Arrays.asList(Object...)).

        Returns:
        the model data.
      • getColumnValueForRow

        java.lang.Object getColumnValueForRow​(T t,
                                              int columnIndex)
        Implementors are expected to return a value at the given column index for the specified row object. This is essentially a more specific version of the TableModel.getValueAt(int, int) that allows this class's comparator objects to work.
        Parameters:
        t - The object that represents a given row.
        columnIndex - The column index for which a value is requested.
        Returns:
        a value at the given column index for the specified row object.
      • fireTableDataChanged

        void fireTableDataChanged()
        Sends an event to all listeners that all the data inside of this model may have changed.