Need explaining on what code does : <p>So I have this code because I need to add photos to my JTable and so I need to make an abstract table model. However, after seeing this code I seriously have no idea what It does, but I really want to understand it. If you could please explain it to me that would be awesome! (I also have no idea what Icon.class does inside of the code). The code is the following:</p>

<pre><code>public class TheModel extends AbstractTableModel {

    private String[] columns;
    private Object[][] rows;

    public TheModel(){}

    public TheModel(Object[][] data, String[] columnName){

        this.rows = data;
        this.columns = columnName;
    }


    public Class getColumnClass(int column){
// 4 is the index of the column image
        if(column == 4){
            return Icon.class;
        }
        else{
            return getValueAt(0,column).getClass();
        }
    }


    public int getRowCount() {
     return this.rows.length;
    }

    public int getColumnCount() {
     return this.columns.length;
    }


    public Object getValueAt(int rowIndex, int columnIndex) {

    return this.rows[rowIndex][columnIndex];
    }
    public String getColumnName(int col){
        return this.columns[col];
    }


}
</code></pre>

<p>Every explanation is greatly appreciated! I know this website is mostly for help with coding problems not with explaining but I really hope you guys could make an exception .</p>
