Package adams.gui.tools
Class LogEntryViewerTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- adams.gui.core.AbstractBaseTableModel
-
- adams.gui.tools.LogEntryViewerTableModel
-
- All Implemented Interfaces:
LoggingLevelHandler,LoggingSupporter,SpreadSheetSupporter,CustomSearchTableModel,Serializable,TableModel
public class LogEntryViewerTableModel extends AbstractBaseTableModel implements CustomSearchTableModel
The table model for displaying LogEntry objects.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<LogEntry>m_Datathe underlying data.-
Fields inherited from class adams.gui.core.AbstractBaseTableModel
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description LogEntryViewerTableModel()Initializes the model with no data.LogEntryViewerTableModel(List<LogEntry> data)Initializes the model with the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(LogEntry entry)Adds the log entry to the model (appended at the end).voidadd(LogEntry entry, boolean sort)Adds the log entry to the model.voidaddAll(Collection<LogEntry> entries)Adds the log entries to the model (appended at the end).voidaddAll(Collection<LogEntry> entries, boolean sort)Adds the log entries to the model.voidclear()Removes all entries.ClassgetColumnClass(int column)Returns the class for the column.intgetColumnCount()Returns the number of columns in the table.StringgetColumnName(int column)Returns the name of the column.List<LogEntry>getData()Returns the underlying data.LogEntrygetLogEntryAt(int row)Returns the LogEntry at the given position.intgetRowCount()Returns the number of rows.ObjectgetValueAt(int row, int column)Returns the value at the given position.booleanisSearchMatch(SearchParameters params, int row)Tests whether the search matches the specified row.-
Methods inherited from class adams.gui.core.AbstractBaseTableModel
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, setLoggingLevel, toSpreadSheet, toString
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Method Detail
-
getRowCount
public int getRowCount()
Returns the number of rows.- Specified by:
getRowCountin interfaceTableModel- Returns:
- the number of rows
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the table.Host IP DB-ID Generation Type Statuts Source
- Specified by:
getColumnCountin interfaceTableModel- Returns:
- the number of columns, always 7
-
getColumnName
public String getColumnName(int column)
Returns the name of the column.- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel- Parameters:
column- the column to retrieve the name for- Returns:
- the name of the column
-
getLogEntryAt
public LogEntry getLogEntryAt(int row)
Returns the LogEntry at the given position.- Parameters:
row- the row in the table- Returns:
- the entry
-
getValueAt
public Object getValueAt(int row, int column)
Returns the value at the given position.- Specified by:
getValueAtin interfaceTableModel- Parameters:
row- the row in the tablecolumn- the column in the table- Returns:
- the value
-
getColumnClass
public Class getColumnClass(int column)
Returns the class for the column.- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel- Parameters:
column- the column to retrieve the class for- Returns:
- the class
-
isSearchMatch
public boolean isSearchMatch(SearchParameters params, int row)
Tests whether the search matches the specified row.- Specified by:
isSearchMatchin interfaceCustomSearchTableModel- Parameters:
params- the search parametersrow- the row of the underlying, unsorted model- Returns:
- true if the search matches this row
-
clear
public void clear()
Removes all entries.
-
add
public void add(LogEntry entry)
Adds the log entry to the model (appended at the end).- Parameters:
entry- the entry to add
-
add
public void add(LogEntry entry, boolean sort)
Adds the log entry to the model. Entry can be inserted at the end or in sorted fashion.- Parameters:
entry- the entry to addsort- whether to sort the data
-
addAll
public void addAll(Collection<LogEntry> entries)
Adds the log entries to the model (appended at the end).- Parameters:
entries- the entries to add
-
addAll
public void addAll(Collection<LogEntry> entries, boolean sort)
Adds the log entries to the model. Entries can be inserted at the end or in sorted fashion.- Parameters:
entries- the entries to addsort- whether to sort the data
-
-