com.maxifier.mxcache.jconsoleplugin.MxCacheTableModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mxcache-jmx Show documentation
Show all versions of mxcache-jmx Show documentation
MxCache management extensions and JConsole plugin
/*
* Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
*/
package com.maxifier.mxcache.jconsoleplugin;
import javax.swing.table.AbstractTableModel;
/**
* @author Alexander Kochurov ([email protected])
*/
class MxCacheTableModel extends AbstractTableModel {
private static final Attribute[] ATTRIBUTES = Attribute.values();
private Object[][] rows = {};
@Override
public String getColumnName(int column) {
return ATTRIBUTES[column].toString();
}
@Override
public int getRowCount() {
return rows == null ? 0 : rows.length;
}
@Override
public int getColumnCount() {
return ATTRIBUTES.length;
}
@Override
public Object getValueAt(int row, int col) {
return rows[row][col];
}
@Override
public void setValueAt(Object value, int row, int col) {
throw new UnsupportedOperationException();
}
public void setRows(Object[][] rows) {
this.rows = rows;
fireTableDataChanged();
}
}