class IndexedTableModel extends AbstractTableModel
{

    private static final String[] COLUMNSNAMES = {"Index", "RGB value", "Color"};
    private final IndexedColorant[] data;

    /**
     * Constructor
     * @param colorants array of IndexedColorant
     */
    public IndexedTableModel(IndexedColorant[] colorants)
    {
        data = colorants;
    }

    @Override
    public int getRowCount()
    {
        return data.length;
    }

    @Override
    public int getColumnCount()
    {
        return COLUMNSNAMES.length;
    }

    @Override
    public Object getValueAt(int row, int column)
    {<FILL_FUNCTION_BODY>}

    @Override
    public String getColumnName(int column)
    {
        return COLUMNSNAMES[column];
    }

    @Override
    public Class<?> getColumnClass(int columnIndex)
    {
        switch (columnIndex)
        {
            case 0:
                return Integer.class;
            case 1:
                return String.class;
            case 2:
                return Color.class;
            default:
                return null;
        }
    }
}

        switch (column)
        {
            case 0:
                return data[row].getIndex();
            case 1:
                return data[row].getRGBValuesString();
            case 2:
                return data[row].getColor();
            default:
                return null;
        }
    
<methods>public void addTableModelListener(javax.swing.event.TableModelListener) ,public int findColumn(java.lang.String) ,public void fireTableCellUpdated(int, int) ,public void fireTableChanged(javax.swing.event.TableModelEvent) ,public void fireTableDataChanged() ,public void fireTableRowsDeleted(int, int) ,public void fireTableRowsInserted(int, int) ,public void fireTableRowsUpdated(int, int) ,public void fireTableStructureChanged() ,public Class<?> getColumnClass(int) ,public java.lang.String getColumnName(int) ,public T[] getListeners(Class<T>) ,public javax.swing.event.TableModelListener[] getTableModelListeners() ,public boolean isCellEditable(int, int) ,public void removeTableModelListener(javax.swing.event.TableModelListener) ,public void setValueAt(java.lang.Object, int, int) <variables>protected javax.swing.event.EventListenerList listenerList