Package net.sf.freecol.client.gui.panel
Class ServerListTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- net.sf.freecol.client.gui.panel.ServerListTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
class ServerListTableModel extends javax.swing.table.AbstractTableModel
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
columnNames
private java.util.List<ServerInfo>
items
-
Constructor Summary
Constructors Constructor Description ServerListTableModel(java.util.List<ServerInfo> items)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColumnCount()
Returns the amount of columns in this statesTable.java.lang.String
getColumnName(int column)
Returns the name of the specified column.ServerInfo
getItem(int row)
Gets the given item.int
getRowCount()
Returns the amount of rows in this statesTable.java.lang.Object
getValueAt(int row, int column)
Returns the value at the requested location.void
setItems(java.util.List<ServerInfo> items)
Sets the items that should be contained by this model.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Field Detail
-
columnNames
private static final java.lang.String[] columnNames
-
items
private java.util.List<ServerInfo> items
-
-
Constructor Detail
-
ServerListTableModel
public ServerListTableModel(java.util.List<ServerInfo> items)
-
-
Method Detail
-
setItems
public void setItems(java.util.List<ServerInfo> items)
Sets the items that should be contained by this model.- Parameters:
items
- TheArrayList
containing the items.
-
getItem
public ServerInfo getItem(int row)
Gets the given item.- Parameters:
row
- The row-number identifying aServerInfo
-line.- Returns:
- The
ServerInfo
.
-
getColumnCount
public int getColumnCount()
Returns the amount of columns in this statesTable.- Returns:
- The amount of columns in this statesTable.
-
getColumnName
public java.lang.String getColumnName(int column)
Returns the name of the specified column.- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
- Returns:
- The name of the specified column.
-
getRowCount
public int getRowCount()
Returns the amount of rows in this statesTable.- Returns:
- The amount of rows in this statesTable.
-
getValueAt
public java.lang.Object getValueAt(int row, int column)
Returns the value at the requested location.- Parameters:
row
- The requested row.column
- The requested column.- Returns:
- The value at the requested location.
-
-