com.datamessenger.util
Class Table


java.lang.Object

  |

  +--com.datamessenger.util.RecordSet

        |

        +--com.datamessenger.util.Table


public class Table
extends RecordSet


Fields inherited from class com.datamessenger.util.RecordSet
header, length, width
 
Constructor Summary
Table()
           
Table(int width)
          Creates a Table with the specified number of columns.
Table(java.lang.Object[] fields)
          Creates a Table with a number of columns equal to the length of an Object array.
Table(java.util.Vector fields)
          Creates a Table with a number of columns equal to the size of a Vector.
 
Method Summary
 void addTableListener(TableListener l)
           
 void clearSelectedRecords()
           
protected  void fireEvent(java.lang.String type)
           
 EventBinder getBinder()
           
 DataCell getCell(int column, int row)
           
 DataCell getCell(java.lang.Object field, int row)
           
 java.text.Format getColumnFormat(java.lang.Object column)
           
 RecordSet getRecordSetInstance()
          Creates a new empty RecordSet with the same column fields.
 int getSelectedIndex()
           
 Table getSelectedRecords()
           
 java.lang.Object getValue(int col, int row)
          Finds the cell value in a column at a row index.
 int indexOf(DataCell cell)
           
 void insertColumnAt(java.lang.Object name, int col)
          Inserts a new column at the specified index.
 boolean isSelectedRecord(int row)
           
 boolean isSelecting()
           
 boolean isUpdating()
           
 void removeTableListener(TableListener l)
           
 void setColumnFormat(java.text.Format format, java.lang.Object column)
           
 void setLength(int length)
          Sets the length of the RecordSet.
 void setSelectedCells(int startx, int starty, int endx, int endy, boolean select)
           
 void setSelectedRecords(int strPos, int endPos, boolean select)
           
 void setValue(java.lang.Object value, int col, int row)
          Sets the cell value in a column at a row index.
 void setWidth(int width)
          Sets the width of the RecordSet.
 void update()
           
 
Methods inherited from class com.datamessenger.util.RecordSet
add, addColumn, clone, deleteColumnAt, deleteRowAt, fill, fill, getColumn, getColumn, getColumnForName, getColumnIndex, getColumnIndex, getFillConstraints, getHeader, getNameField, getRecord, getRecords, getRecords, getRow, getValue, getValues, indexOf, indexOf, insertRowAt, length, lock, lookUp, lookUp, lookUpAll, print, setNameField, setValue, width
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Table


public Table()

Table


public Table(int width)
Creates a Table with the specified number of columns.
Parameters:
width - the number of columns. This constructor defines the column names by using the A-Z format common to spreadsheets.

Table


public Table(java.util.Vector fields)
Creates a Table with a number of columns equal to the size of a Vector. Vector elements are used as keys for defining column names.
Parameters:
fields - the header field names.
See Also:
#getValue(Object, Object)

Table


public Table(java.lang.Object[] fields)
Creates a Table with a number of columns equal to the length of an Object array. Array elements are used as keys for defining column names.
Parameters:
fields - the header field names.
Method Detail

insertColumnAt


public void insertColumnAt(java.lang.Object name,

                           int col)
Inserts a new column at the specified index. Columns at or above the index are shifted to the right.
Overrides:
insertColumnAt in class RecordSet
Parameters:
name - The column name Object
col - the insert index.
Throws:
ArrayIndexOutOfBoundsException() -  

getValue


public java.lang.Object getValue(int col,

                                 int row)
Finds the cell value in a column at a row index.
Overrides:
getValue in class RecordSet
Parameters:
col - the column index.
row - the row index.
Returns:
a cell value from the RecordSet or null if out of range.

setValue


public void setValue(java.lang.Object value,

                     int col,

                     int row)
Description copied from class: RecordSet
Sets the cell value in a column at a row index.
Overrides:
setValue in class RecordSet
Tags copied from class: RecordSet
Parameters:
col - the column name.
row - the row index.
Throws:
ArrayIndexOutOfBoundsException() - if the index is out of range.

setWidth


public void setWidth(int width)
Description copied from class: RecordSet
Sets the width of the RecordSet. The names for added columns (if any) are equal to the index value for the A-Z format common to spreadsheets. Columns to the right of the specified width (if any) are deleted.
Overrides:
setWidth in class RecordSet
Tags copied from class: RecordSet
Parameters:
width - the new width
Throws:
NegativeArraySizeException() - if width < 0.

setLength


public void setLength(int length)
Description copied from class: RecordSet
Sets the length of the RecordSet. New rows will contain null values.
Overrides:
setLength in class RecordSet
Tags copied from class: RecordSet
Parameters:
length - the new length
Throws:
NegativeArraySizeException() - if length < 0.

indexOf


public int indexOf(DataCell cell)

update


public void update()

isUpdating


public boolean isUpdating()

getBinder


public EventBinder getBinder()

getCell


public DataCell getCell(java.lang.Object field,

                        int row)

getCell


public DataCell getCell(int column,

                        int row)

setColumnFormat


public void setColumnFormat(java.text.Format format,

                            java.lang.Object column)

getColumnFormat


public java.text.Format getColumnFormat(java.lang.Object column)

setSelectedCells


public void setSelectedCells(int startx,

                             int starty,

                             int endx,

                             int endy,

                             boolean select)

setSelectedRecords


public void setSelectedRecords(int strPos,

                               int endPos,

                               boolean select)

getSelectedRecords


public Table getSelectedRecords()

getSelectedIndex


public int getSelectedIndex()

isSelectedRecord


public boolean isSelectedRecord(int row)

isSelecting


public boolean isSelecting()

clearSelectedRecords


public void clearSelectedRecords()

addTableListener


public void addTableListener(TableListener l)

removeTableListener


public void removeTableListener(TableListener l)

fireEvent


protected void fireEvent(java.lang.String type)

getRecordSetInstance


public RecordSet getRecordSetInstance()
Description copied from class: RecordSet
Creates a new empty RecordSet with the same column fields. Sub-classes should override this method to return an Object of the appropriate type.
Overrides:
getRecordSetInstance in class RecordSet
Tags copied from class: RecordSet
Returns:
a new Recordset instance.


Comments, suggestions, and bug reports are welcomed and encouraged.
Please refer them to our support page. Thank you.

Copyright © 1999-2001 Produx House, Corp. All rights reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc.