19 package org.sleuthkit.autopsy.datasourcesummary.uiutils;
21 import java.util.ArrayList;
22 import java.util.Collections;
23 import java.util.List;
24 import java.util.function.Function;
25 import javax.swing.table.AbstractTableModel;
34 private final List<Function<T, ? extends Object>>
columns;
35 private List<T>
dataRows = Collections.emptyList();
56 this.dataRows = dataRows == null ? Collections.emptyList() :
new ArrayList<>(
dataRows);
57 super.fireTableDataChanged();
62 return dataRows.size();
67 return columns.size();
71 public Object
getValueAt(
int rowIndex,
int columnIndex) {
73 if (rowIndex < 0 || rowIndex >= dataRows.size() || columnIndex < 0 || columnIndex >= columns.size()) {
79 return columns.get(columnIndex).apply(dataRows.get(rowIndex));
DefaultListTableModel(List< Function< T,?extends Object >> columns)
Object getValueAt(int rowIndex, int columnIndex)
final List< Function< T,?extends Object > > columns
static final long serialVersionUID
void setDataRows(List< T > dataRows)