LogDataTableModel extends AbstractTableModel implements LogDataCollector, MarkableTableModel, NotableTableModel { public Object getValueAt(int rowIndex, int columnIndex) { LogData ld = getLogData(rowIndex); if (ld == null) { System.err.println("LogDataTableModel.getValueAt() null form row " + rowIndex); dumpInfo(); } Object result = null; TableColumns selectColumn = TableColumns.getColumnById(columnIndex); assert ld != null; switch (selectColumn) { case ID: result = ld.getId(); break; case TIME: result = ld.getDate(); break; case DELTA: result = new TimeDelta(ld.getDate()); break; case LEVEL: result = ld.getLevel(); break; case MESSAGE: result = ld.getMessage(); break; case CLASS: String clazz = ld.getClazz(); if (!classWrapperCache.containsKey(clazz)) { classWrapperCache.put(clazz, new ClassWrapper(clazz)); } result = classWrapperCache.get(clazz); break; case METHOD: int maximumMessageLength = 2000; result = StringUtils.left(ld.getMethod(), maximumMessageLength); break; case THREAD: result = ld.getThread(); break; case MARK: result = ld.getMarkerColors(); break; case NOTE: result = ld.getNote(); if (result == null) { result = EMPTY_NOTE; } break; case FILE: result = ld.getFile(); break; case LINE: result = ld.getLine(); break; case NDC: result = ld.getNDC(); break; case PROPERTIES: result = getProperties(ld); break; case LOGGER_NAME: final String loggerName = ld.getLoggerName(); if (!classWrapperCache.containsKey(loggerName)) { classWrapperCache.put(loggerName, new ClassWrapper(loggerName)); } result = classWrapperCache.get(loggerName); break; case LOG_SOURCE: result = ld.getLogSource(); break; default: 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 testGetValueAt() { for (int i = 0; i < logDatas.length; i++) { Level level = (Level) dataTableModel.getValueAt(i, TableColumns.LEVEL.getColumn()); AssertJUnit.assertEquals(logDatas[i].getLevel(), level); String thread = (String) dataTableModel.getValueAt(i, TableColumns.THREAD.getColumn()); AssertJUnit.assertEquals(logDatas[i].getThread(), thread); } }