LogDataTableModel extends AbstractTableModel implements LogDataCollector, MarkableTableModel, NotableTableModel { @Override public Class<?> getColumnClass(int columnIndex) { Class<?> result; TableColumns selectedColumn = TableColumns.getColumnById(columnIndex); switch (selectedColumn) { case ID: result = Integer.class; break; case TIME: result = Date.class; break; case DELTA: result = TimeDelta.class; break; case LEVEL: result = Level.class; break; case MESSAGE: result = String.class; break; case CLASS: case LOGGER_NAME: result = ClassWrapper.class; break; case MARK: result = MarkerColors.class; break; case NOTE: result = Note.class; break; default: result = String.class; break; } return result; } LogDataTableModel(); String getColumnName(int column); int getColumnCount(); int getRowCount(); Object getValueAt(int rowIndex, int columnIndex); boolean isCellEditable(int rowIndex, int columnIndex); void add(LogData... logDatas); void add(LogData logData); int removeRows(AcceptCondition acceptCondition); @Override Class<?> getColumnClass(int columnIndex); LogData getLogData(int row); LogData[] getLogData(); @Override int getCount(); @Override void setValueAt(Object value, int rowIndex, int columnIndex); @Override boolean isMarked(int row); @Override MarkerColors getMarkerColors(int row); @Override void markRows(MarkerColors markerColor, int... rows); @Override void unmarkRows(int... rows); @Override void addNoteToRow(int row, Note note); @Override void clearNotes(); @Override TreeMap<Integer, Note> getAllNotes(); @Override Note getNote(int row); @Override Note removeNote(int row); @Override void addNoteObserver(NoteObserver observer); @Override void removeAllNoteObserver(); @Override void removeNoteObserver(NoteObserver observer); @Override void notifyAllNoteObservers(NoteEvent noteEvent); Memento saveToMemento(); void restoreFromMemento(Memento memento); int getDataLimit(); void setDataLimit(int dataLimit); @Override Note removeNote(int row, boolean notify); @Override int clear(); LogDataStore getLogDataStore();  }
@Test public void testGetColumnClassInt() { AssertJUnit.assertEquals(Level.class, dataTableModel.getColumnClass(TableColumns.LEVEL.getColumn())); AssertJUnit.assertEquals(String.class, dataTableModel.getColumnClass(TableColumns.MESSAGE.getColumn())); AssertJUnit.assertEquals(Note.class, dataTableModel.getColumnClass(TableColumns.NOTE.getColumn())); AssertJUnit.assertEquals(Date.class, dataTableModel.getColumnClass(TableColumns.TIME.getColumn())); }