de.jaret.util.ui.table.model
Class DefaultJaretTableModel

java.lang.Object
  extended by de.jaret.util.ui.table.model.AbstractJaretTableModel
      extended by de.jaret.util.ui.table.model.DefaultJaretTableModel
All Implemented Interfaces:
IJaretTableModel
Direct Known Subclasses:
PropListeningTableModel

public class DefaultJaretTableModel
extends AbstractJaretTableModel
implements IJaretTableModel

Default Jaret table model.

Version:
$Id: DefaultJaretTableModel.java 400 2007-05-01 17:40:47Z olk $
Author:
Peter Kliem

Field Summary
protected  java.util.List<IColumn> _cols
          columns.
protected  java.util.List<IRow> _rows
          rows.
 
Fields inherited from class de.jaret.util.ui.table.model.AbstractJaretTableModel
_listeners
 
Constructor Summary
DefaultJaretTableModel()
           
 
Method Summary
 void addColumn(IColumn column)
          Add a column to the model.
 void addRow(int index, IRow row)
          Add a row to the model at a specified index.
 void addRow(IRow row)
          Add a row to the model.
 IColumn getColumn(int idx)
          Retrieve a column specified by it's index.
 IColumn getColumn(java.lang.String id)
          Retrieve a column by it's ID.
 int getColumnCount()
          Retrieve the number of columns.
 IRow getRow(int idx)
          Retrieve a specific row.
 int getRowCount()
          Return the number of rows in the model.
 void remColumn(IColumn column)
          Remove a column from the model.
 void remRow(IRow row)
          Remove row from the model.
 
Methods inherited from class de.jaret.util.ui.table.model.AbstractJaretTableModel
addJaretTableModelListener, fireCellChanged, fireColumnAdded, fireColumnChanged, fireColumnRemoved, fireRowAdded, fireRowChanged, fireRowRemoved, fireTableDataChanged, isEditable, removeJaretTableModelListener, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.jaret.util.ui.table.model.IJaretTableModel
addJaretTableModelListener, isEditable, removeJaretTableModelListener, setValue
 

Field Detail

_rows

protected java.util.List<IRow> _rows
rows.


_cols

protected java.util.List<IColumn> _cols
columns.

Constructor Detail

DefaultJaretTableModel

public DefaultJaretTableModel()
Method Detail

getRowCount

public int getRowCount()
Return the number of rows in the model.

Specified by:
getRowCount in interface IJaretTableModel
Returns:
number of rows

getRow

public IRow getRow(int idx)
Retrieve a specific row.

Specified by:
getRow in interface IJaretTableModel
Parameters:
idx - index of the row
Returns:
the row

addRow

public void addRow(IRow row)
Add a row to the model.

Parameters:
row - row to add

addRow

public void addRow(int index,
                   IRow row)
Add a row to the model at a specified index.

Parameters:
index - index the row will be inserted
row - row to add

remRow

public void remRow(IRow row)
Remove row from the model.

Parameters:
row - row to remove

getColumnCount

public int getColumnCount()
Retrieve the number of columns.

Specified by:
getColumnCount in interface IJaretTableModel
Returns:
the number of columns.

getColumn

public IColumn getColumn(int idx)
Retrieve a column specified by it's index.

Specified by:
getColumn in interface IJaretTableModel
Parameters:
idx - index of the column to retrieve
Returns:
column at index idx

getColumn

public IColumn getColumn(java.lang.String id)
Retrieve a column by it's ID.

Specified by:
getColumn in interface IJaretTableModel
Overrides:
getColumn in class AbstractJaretTableModel
Parameters:
id - id of the column to look for
Returns:
the column or null if no Column with the id could be found.

addColumn

public void addColumn(IColumn column)
Add a column to the model.

Specified by:
addColumn in interface IJaretTableModel
Parameters:
column - col to add

remColumn

public void remColumn(IColumn column)
Remove a column from the model.

Parameters:
column - col to remove


Copyright © 2012. All Rights Reserved.