org.apache.tapestry.contrib.table.model.simple
Class SimpleListTableDataModel

java.lang.Object
  extended by org.apache.tapestry.contrib.table.model.common.AbstractTableDataModel
      extended by org.apache.tapestry.contrib.table.model.simple.SimpleListTableDataModel
All Implemented Interfaces:
Serializable, ITableDataModel

public class SimpleListTableDataModel
extends AbstractTableDataModel
implements Serializable

A minimal list implementation of the ITableDataModel interface

Version:
$Id: SimpleListTableDataModel.java 243791 2004-02-19 17:38:13Z hlship $
Author:
mindbridge
See Also:
Serialized Form

Constructor Summary
SimpleListTableDataModel(Collection arrRows)
           
SimpleListTableDataModel(Iterator objRows)
           
SimpleListTableDataModel(List arrRows)
           
SimpleListTableDataModel(Object[] arrRows)
           
 
Method Summary
 void addRow(Object objRow)
          Method addRow.
 void addRows(Collection arrRows)
           
 Object getRow(int nRow)
          Returns the row element at the given position
 int getRowCount()
          Method getRowCount.
 Iterator getRows()
          Iterates over all of the rows in the model
 Iterator getRows(int nFrom, int nTo)
          Returns an Iterator with the elements from the given range
 void removeRow(Object objRow)
          Method removeRow.
 void removeRows(Collection arrRows)
           
 
Methods inherited from class org.apache.tapestry.contrib.table.model.common.AbstractTableDataModel
addTableDataModelListener, fireTableDataModelEvent, removeTableDataModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleListTableDataModel

public SimpleListTableDataModel(Object[] arrRows)

SimpleListTableDataModel

public SimpleListTableDataModel(List arrRows)

SimpleListTableDataModel

public SimpleListTableDataModel(Collection arrRows)

SimpleListTableDataModel

public SimpleListTableDataModel(Iterator objRows)
Method Detail

getRowCount

public int getRowCount()
Description copied from interface: ITableDataModel
Method getRowCount.

Specified by:
getRowCount in interface ITableDataModel
Returns:
int the number of rows in the model
See Also:
ITableDataModel.getRowCount()

getRow

public Object getRow(int nRow)
Returns the row element at the given position

Parameters:
nRow - the index of the element to return

getRows

public Iterator getRows(int nFrom,
                        int nTo)
Returns an Iterator with the elements from the given range

Parameters:
nFrom - the start of the range (inclusive)
nTo - the stop of the range (exclusive)

getRows

public Iterator getRows()
Description copied from interface: ITableDataModel
Iterates over all of the rows in the model

Specified by:
getRows in interface ITableDataModel
Returns:
Iterator the iterator for access to the data
See Also:
ITableDataModel.getRows()

addRow

public void addRow(Object objRow)
Method addRow. Adds a row object to the model at its end

Parameters:
objRow - the row object to add

addRows

public void addRows(Collection arrRows)

removeRow

public void removeRow(Object objRow)
Method removeRow. Removes a row object from the model

Parameters:
objRow - the row object to remove

removeRows

public void removeRows(Collection arrRows)