Oracle JEWT 4.2.10

oracle.bali.ewt.model
Class ArrayTwoDModel

java.lang.Object
  |
  +--oracle.bali.ewt.model.AbstractTwoDModel
        |
        +--oracle.bali.ewt.model.ArrayTwoDModel
All Implemented Interfaces:
TwoDModel

public class ArrayTwoDModel
extends AbstractTwoDModel

An ArrayTwoDModel is a two dimensional data source that stores data in a two dimensional array. Clients can specify how many columns and rows the ArrayTwoDModel contains at creation time. Clients can add and remove columns and rows with the addColumns, removeColumns, addRows, removeRows methods. Clients can set the data for a cell with the setData method.

ArrayTwoDModel sends the proper TwoDModelEvents to the list of registered listeners.

See Also:
TwoDModel, TwoDModelEvent, TwoDModelListener

Constructor Summary
ArrayTwoDModel(int columns, int rows)
          Create a ArrayTwoDModel with the given number of columns and rows.
ArrayTwoDModel(java.lang.Object[][] contents)
          Creates a ArrayTwoDModel from the specified two dimensional array.
 
Method Summary
 void addColumns(int startIndex, int numberOfColumns)
          Add numberOfColumns more columns starting at index, startIndex.
 void addRows(int startIndex, int numberOfRows)
          Add numberOfRows more rows starting at index, startIndex.
 int getColumnCount()
          Get the number of columns.
 java.lang.Object getData(int columnIndex, int rowIndex)
          Return the data of the cell.
 int getRowCount()
          Get the number of rows.
 void removeColumns(int startIndex, int numberOfColumns)
          Remove numberOfColumns starting from startIndex.
 void removeRows(int startIndex, int numberOfRows)
          Remove numberOfRows starting from startIndex.
 void setData(int columnIndex, int rowIndex, java.lang.Object data)
          Set the cell data to the new value.
 
Methods inherited from class oracle.bali.ewt.model.AbstractTwoDModel
addModelListener, fireModelEvent, fireModelEvent, removeModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayTwoDModel

public ArrayTwoDModel(int columns,
                      int rows)
Create a ArrayTwoDModel with the given number of columns and rows.

Parameters:
columns - the initial number of columns in the model.
rows - the initial number of rows in the model.

ArrayTwoDModel

public ArrayTwoDModel(java.lang.Object[][] contents)
Creates a ArrayTwoDModel from the specified two dimensional array.

Parameters:
columns - the initial number of columns in the model.
rows - the initial number of rows in the model.
Method Detail

addRows

public void addRows(int startIndex,
                    int numberOfRows)
Add numberOfRows more rows starting at index, startIndex.

Parameters:
startIndex - the row index from which to add
numberOfRows - the number of rows to add

removeRows

public void removeRows(int startIndex,
                       int numberOfRows)
Remove numberOfRows starting from startIndex.

Parameters:
startIndex - the row index from which to remove
numberOfRows - the number of rows to remove

addColumns

public void addColumns(int startIndex,
                       int numberOfColumns)
Add numberOfColumns more columns starting at index, startIndex.

Parameters:
startIndex - the column index from which to add
numberOfColumns - the number of columns to add

removeColumns

public void removeColumns(int startIndex,
                          int numberOfColumns)
Remove numberOfColumns starting from startIndex.

Parameters:
startIndex - the column index from which to remove
numberOfColumns - the number of columns to remove

getColumnCount

public int getColumnCount()
Get the number of columns.
Overrides:
getColumnCount in class AbstractTwoDModel
Following copied from class: oracle.bali.ewt.model.AbstractTwoDModel
Returns:
the number of columns in this TwoDModel.

getRowCount

public int getRowCount()
Get the number of rows.
Overrides:
getRowCount in class AbstractTwoDModel
Following copied from class: oracle.bali.ewt.model.AbstractTwoDModel
Returns:
the number of rows in this TwoDModel.

getData

public java.lang.Object getData(int columnIndex,
                                int rowIndex)
Return the data of the cell.

Overrides:
getData in class AbstractTwoDModel
Parameters:
columnIndex - the column index of the cell
rowIndex - the row index of the cell

setData

public void setData(int columnIndex,
                    int rowIndex,
                    java.lang.Object data)
Set the cell data to the new value.

Overrides:
setData in class AbstractTwoDModel
Parameters:
rowIndex - row index of the cell
columnIndex - column index of the cell
data - new data

Oracle JEWT 4.2.10