All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.maxifier.mxcache.jconsoleplugin.MxCacheTableModel Maven / Gradle / Ivy

There is a newer version: 2.6.9
Show newest version
/*
 * 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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy