# Class ResourceTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
uk.ac.starlink.util.gui.ArrayTableModel<RegResource>
uk.ac.starlink.vo.ResourceTableModel

All Implemented Interfaces:
  `Serializable, TableModel`

public class ResourceTableModel extends uk.ac.starlink.util.gui.ArrayTableModel<RegResource>
TableModel in which each row represents a `RegResource`.

Since:
  18 Dec 2008
Author:
  Mark Taylor
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class AbstractTableModel

`listenerList`

## Constructor Summary

Constructors
Constructor
Description
`ResourceTableModel()`
Constructs a ResourceTableModel with no AccessRef column.
`ResourceTableModel(boolean includeAcref)`
Constructs a ResourceTableModel with an optional AccessRef column.

## Method Summary

Modifier and Type
Method
Description
`RegResource[]`
`getResources()`
Returns the data array for this table.
`void`
`setResources(RegResource[] resources)`
Sets the data for this table.

### Methods inherited from class uk.ac.starlink.util.gui.ArrayTableModel

`getColumnClass, getColumnCount, getColumnName, getColumns, getItems, getRowCount, getValueAt, setColumns, setItems, sortByColumn`

### Methods inherited from class AbstractTableModel

`addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ResourceTableModel

public ResourceTableModel()
Constructs a ResourceTableModel with no AccessRef column.

### ResourceTableModel

public ResourceTableModel(boolean includeAcref)
Constructs a ResourceTableModel with an optional AccessRef column. This is a bit problematic - there is not a formal 1:1 relationship between RegResources, which is what are displayed per-row in this table, and RegCapabilityInterfaces, which are what host AccessRefs (a.k.a. Service URLs). In many cases however, the relationship is in fact 1:1. If `includeAcref` is set true, a column is added for this information, and it's populated only in the cases where a 1:1 relationship does actually hold.

Parameters:
  `includeAcref` - true if the access ref column is to be included

## Method Details

### setResources

public void setResources(RegResource[] resources)
Sets the data for this table.

Parameters:
  `resources` - resource array

### getResources

public RegResource[] getResources()
Returns the data array for this table.

Returns:
  resource array