Class com.symantec.itools.swing.models.StringTableModel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.symantec.itools.swing.models.StringTableModel

Object
   |
   +----AbstractTableModel
           |
           +----com.symantec.itools.swing.models.StringTableModel

public class StringTableModel
extends AbstractTableModel
implements Serializable

Variable Index

 o colCount
The number of columns currently in the table.
 o dataVector
A Vector of Vectors containing the table's data
 o editable
A boolean indicating whether the table in general is editable.
 o editableVector
A vector of vectors containg booleans indicating editability of each cell in the table.
 o headerVector
A vector containing the column headers

Constructor Index

 o com.symantec.itools.swing.models.StringTableModel()

Method Index

 o addElement(Object, int)
Calls the Vector.addElement() on the specified row in dataVector
 o addRow(String)
Add a row of data.
 o capacity(int)
Calls the Vector.Capacity() on the specified row in dataVector
 o columnContains(Object, int)
Determines whether the specified column contains the specified object.
 o copyInto(Object[][])
Fills anArray with corresponding values in dataVector by calling getElementAt(int,int)
 o elementAt(int, int)
Calls the Vector.elementAt() on the specified row in dataVector
 o elements(int)
Calls the Vector.elements() on the specified row in dataVector
 o ensureCapacity(int, int)
Calls the Vector.ensureCapacity() on the specified row in dataVector
 o firstElement(int)
Calls the Vector.firstElement() on the specified row in dataVector
 o getColumnClass(int)
Returns the class of the type of object held in this column.
 o getColumnCount()
Returns the number of columns in the table.
 o getColumnHeaders()
Calls getColumnHeaders(char)
 o getColumnHeaders(char)
Constructs a comma-delimited string from headerVector
 o getColumnName(int)
Returns the header for specified column.
 o getElementAt(int, int)
Gets the value from a particular cell.
 o getItems()
Calls getItems(char)
 o getItems(char)
Called by getItems().
 o getNumRows()
Returns the number of rows in dataVector.
 o getRow(int)
Calls getRow(int,char) Get a particular row of data.
 o getRow(int, char)
Get a particular row of data.
 o getRowCount()
Returns the number of rows in the table.
 o getValueAt(int, int)
Returns the value in the specified cell
 o indexOf(Object, int)
Calls the Vector.indexOf(object) on the specified row in dataVector
 o indexOf(Object, int, int)
Calls the Vector.indexOf(object,int) on the specified row in dataVector
 o insertElementAt(Object, int, int)
Calls the Vector.insertElementAt() on the specified row in dataVector
 o insertRowAt(String, int)
Calls setItemAt(string,int,boolean)
 o isCellEditable(int, int)
Is the cell editable?
 o isEditable()
Is the table in general editable?
 o isEmpty(int)
Calls the Vector.isEmpty() on the specified row in dataVector
 o lastElement(int)
Calls the Vector.lastElement() on the specified row in dataVector
 o lastIndexOf(Object, int)
Calls the Vector.lastIndexOf(object) on the specified row in dataVector
 o lastIndexOf(Object, int, int)
Calls the Vector.lastIndexOf(object,int) on the specified row in dataVector
 o removeAllElements(int)
Calls the Vector.removeAllElements() on the specified row in dataVector
 o removeElement(Object, int)
Calls the Vector.removeElement() on the specified row in dataVector
 o removeElementAt(int, int)
Calls the Vector.removeElementAt() on the specified row in dataVector
 o removeRow(int)
Removes the specified row from dataVector
 o rowContains(Object, int)
Calls the Vector.contains() on the specified row in dataVector
 o setCellEditable(int, int, boolean)
Set the editability of the specified cell.
 o setColumnHeaders(String)
Calls setcolumnHeaders(String,String)
 o setColumnHeaders(String, String)
Sets the column headers.
 o setEditable(boolean)
Sets whether or not the table in general is editable.
 o setElementAt(Object, int, int)
Calls the Vector.setElementAt() on the specified row in dataVector
 o setItemAt(String, int, boolean)
Calls setItemAt(String,int,boolean,String)
 o setItemAt(String, int, boolean, String)
Puts the item value (row of data) into dataVector Pads any short rows to the widest row with a space.
 o setItems(String[])
Calls setItems(String[],String).
 o setItems(String[], String)
Parses the String array, one row at a time, via a stringtokenizer by calling setItemAt(String,int,boolean,String)
 o setSize(int, int)
Calls the Vector.setSize() on the specified row in dataVector
 o setValueAt(Object, int, int)
Set the value for a specified cell
 o size()
Calls the Vector.Size() on dataVector
 o size(int)
Calls the Vector.Size() on the specified row in dataVector
 o trimToSize(int)
Calls the Vector.trimToSize() on the specified row in dataVector

Variables

 o colCount
protected int colCount
The number of columns currently in the table. This is equal to the widest row of data. The column headers are pinned (padded or truncated) to the width of the data

 o dataVector
protected java.util.Vector dataVector
A Vector of Vectors containing the table's data

 o editable
protected boolean editable
A boolean indicating whether the table in general is editable.

 o editableVector
protected java.util.Vector editableVector
A vector of vectors containg booleans indicating editability of each cell in the table.

 o headerVector
protected java.util.Vector headerVector
A vector containing the column headers

Constructors

 o StringTableModel
public StringTableModel()

Methods

 o addElement
public void addElement(Object obj,
                       int row)
Calls the Vector.addElement() on the specified row in dataVector

Parameters:
obj - The value to add
row - The specified row
 o addRow
public void addRow(String data)
Add a row of data. Calls insertRowAt(String,int)

Parameters:
data - A comma-delimited string.
 o capacity
public int capacity(int row)
Calls the Vector.Capacity() on the specified row in dataVector

Parameters:
row - The specified row
Returns:
The current capacity of the specified row
 o columnContains
public boolean columnContains(Object elem,
                              int col)
Determines whether the specified column contains the specified object.

Parameters:
elem - The specified object
col - The specified column
Returns:
Whether the specified column contains the specified object.
 o copyInto
public void copyInto(Object[][] anArray)
Fills anArray with corresponding values in dataVector by calling getElementAt(int,int)

Parameters:
anArray - Object array
 o elementAt
public java.lang.Object elementAt(int row,
                                  int col)
Calls the Vector.elementAt() on the specified row in dataVector

Parameters:
row - The specified row
col - The specified column
Returns:
The object at the specified row and column.
 o elements
public java.util.Enumeration elements(int row)
Calls the Vector.elements() on the specified row in dataVector

Parameters:
row - The specified row
Returns:
The specified row as an enumeration
 o ensureCapacity
public void ensureCapacity(int minCapacity,
                           int row)
Calls the Vector.ensureCapacity() on the specified row in dataVector

Parameters:
minCapacity - The required capacity
row - The specified row
 o firstElement
public java.lang.Object firstElement(int row)
Calls the Vector.firstElement() on the specified row in dataVector

Parameters:
row - The specified row
Returns:
The first element in the specified row of dataVector
 o getColumnClass
public java.lang.Class getColumnClass(int columnIndex)
Returns the class of the type of object held in this column. In this model, it it always String

Parameters:
columnIndex - The specified column
Returns:
String.class
Overrides:
getColumnClass in class AbstractTableModel
 o getColumnCount
public int getColumnCount()
Returns the number of columns in the table.

Returns:
The number of columns in the table.
Overrides:
getColumnCount in class AbstractTableModel
 o getColumnHeaders
public java.lang.String getColumnHeaders()
Calls getColumnHeaders(char)

Returns:
A comma-delimited string containing the columnHeaders
 o getColumnHeaders
public java.lang.String getColumnHeaders(char sepChar)
Constructs a comma-delimited string from headerVector

Parameters:
sepChar - String - The comma delimiter
Returns:
A comma-delimited string containing the columnHeaders
 o getColumnName
public java.lang.String getColumnName(int column)
Returns the header for specified column. May be space (padded)

Parameters:
column - The specified column
Returns:
The header for specified column.
Overrides:
getColumnName in class AbstractTableModel
 o getElementAt
public java.lang.Object getElementAt(int row,
                                     int col)
Gets the value from a particular cell.

Parameters:
row - The specified row
col - The specified column
Returns:
The value from a particular cell.
 o getItems
public java.lang.String[] getItems()
Calls getItems(char)

Returns:
An array of comma-delimited strings representing the data in the table.
 o getItems
public java.lang.String[] getItems(char appendChar)
Called by getItems(). Constructs the array of comma-delimited string from the data in dataVector.

Parameters:
appendChar - a comma
Returns:
An array of comma-delimited strings representing the data in the table.
 o getNumRows
public int getNumRows()
Returns the number of rows in dataVector.

Returns:
The number of rows
 o getRow
public java.lang.String getRow(int row)
Calls getRow(int,char) Get a particular row of data.

Parameters:
row - The specified row.
Returns:
A comma delimited string containg the elements in the specified row.
 o getRow
public java.lang.String getRow(int row,
                               char appendChar)
Get a particular row of data.

Parameters:
row - The specified row.
appendChar - a comma
Returns:
A comma delimited string containing the elements in the specified row.
 o getRowCount
public int getRowCount()
Returns the number of rows in the table.

Returns:
The number of rows in the table.
Overrides:
getRowCount in class AbstractTableModel
 o getValueAt
public java.lang.Object getValueAt(int row,
                                   int column)
Returns the value in the specified cell

Parameters:
row - The specified row.
column - The specified column
Returns:
The value in the specified cell
Overrides:
getValueAt in class AbstractTableModel
 o indexOf
public int indexOf(Object elem,
                   int row)
Calls the Vector.indexOf(object) on the specified row in dataVector

Parameters:
elem - The specified object
row - The specified row
Returns:
The index of the spcified object in the specified row
 o indexOf
public int indexOf(Object elem,
                   int row,
                   int col)
Calls the Vector.indexOf(object,int) on the specified row in dataVector

Parameters:
elem - The specified object
row - The specified row
col - The specified column
Returns:
The index of the spcified object in the specified row, but begins the search at the specified column.
 o insertElementAt
public void insertElementAt(Object obj,
                            int row,
                            int col)
Calls the Vector.insertElementAt() on the specified row in dataVector

Parameters:
obj - The value to set.
row - the specified row
col - the specified column
 o insertRowAt
public void insertRowAt(String data,
                        int row)
Calls setItemAt(string,int,boolean)

Parameters:
data - A comma-delimited string.
row - The specified row.
 o isCellEditable
public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Is the cell editable?

Parameters:
rowIndex - The specified row
columnIndex - The specified column
Returns:
true if cell is editable
Overrides:
isCellEditable in class AbstractTableModel
 o isEditable
public boolean isEditable()
Is the table in general editable?

Returns:
true if table is editable
 o isEmpty
public boolean isEmpty(int row)
Calls the Vector.isEmpty() on the specified row in dataVector

Parameters:
row - The specified row
Returns:
Whether or not the specified row is empty.
 o lastElement
public java.lang.Object lastElement(int row)
Calls the Vector.lastElement() on the specified row in dataVector

Parameters:
row - The specified row
Returns:
The last element in the specified row of dataVector
 o lastIndexOf
public int lastIndexOf(Object elem,
                       int row)
Calls the Vector.lastIndexOf(object) on the specified row in dataVector

Parameters:
elem - The specified object
row - The specified row
Returns:
The last occurrence of elem in the specified row.
 o lastIndexOf
public int lastIndexOf(Object elem,
                       int row,
                       int col)
Calls the Vector.lastIndexOf(object,int) on the specified row in dataVector

Parameters:
elem - The specified object
row - The specified row
col - The specified column
Returns:
The last occurrence of elem in the specified row, searching backwards from the specified index
 o removeAllElements
public void removeAllElements(int row)
Calls the Vector.removeAllElements() on the specified row in dataVector

Parameters:
row - The specified row
 o removeElement
public boolean removeElement(Object obj,
                             int row)
Calls the Vector.removeElement() on the specified row in dataVector

Parameters:
obj - The value to remove. Removes only the first occurence.
row - The specified row
Returns:
Whether or not the value was found
 o removeElementAt
public void removeElementAt(int row,
                            int col)
Calls the Vector.removeElementAt() on the specified row in dataVector

Parameters:
row - Removes the value at the specified cell row, and
col - the specified column
 o removeRow
public void removeRow(int row)
Removes the specified row from dataVector

Parameters:
row - The specified row.
 o rowContains
public boolean rowContains(Object elem,
                           int row)
Calls the Vector.contains() on the specified row in dataVector

Parameters:
elem - The specified object
row - The specified row
Returns:
Whether or not the specified row contains the specified object
 o setCellEditable
public void setCellEditable(int rowIndex,
                            int columnIndex,
                            boolean f)
Set the editability of the specified cell.

Parameters:
rowIndex - The specified row.
columnIndex - The specified column
f - True or false.
 o setColumnHeaders
public void setColumnHeaders(String newHeaders)
Calls setcolumnHeaders(String,String)

Parameters:
newHeaders - A comma-delimited string containing the column headers
 o setColumnHeaders
public void setColumnHeaders(String newHeaders,
                             String sepChar)
Sets the column headers. If newHeaders is shorter than colCount then the headerVector is padded with spaces. If newHeaders is longer than colCount, they will be stored but not displayed by JTable.

Parameters:
newHeaders - A comma-delimited string containing the column headers
sepChar - String - The comma delimiter
 o setEditable
public void setEditable(boolean isEditable)
Sets whether or not the table in general is editable.

Parameters:
isEditable - boolean
 o setElementAt
public void setElementAt(Object obj,
                         int row,
                         int col)
Calls the Vector.setElementAt() on the specified row in dataVector

Parameters:
obj - object - the value to set
row - The specified row
col - The specified column
 o setItemAt
public void setItemAt(String item,
                      int row,
                      boolean notifyOfChange)
Calls setItemAt(String,int,boolean,String)

Parameters:
item - A comma-delimited string representing a row of data
row - The specified row.
notifyOfChange - Whether or not to broadcast an event.
 o setItemAt
public void setItemAt(String item,
                      int row,
                      boolean notifyOfChange,
                      String sepChar)
Puts the item value (row of data) into dataVector Pads any short rows to the widest row with a space.

Parameters:
item - A comma-delimited string representing a row of data
row - The specified row.
notifyOfChange - Whether or not to broadcast an event.
sepChar - The comma delimiter.
 o setItems
public void setItems(String[] newItems)
Calls setItems(String[],String).

Parameters:
newItems - An array of comma-delimited strings holding the data for the table.
 o setItems
public void setItems(String[] newItems,
                     String sepChar)
Parses the String array, one row at a time, via a stringtokenizer by calling setItemAt(String,int,boolean,String)

Parameters:
newItems - The string array of data
sepChar - The comma delimiter
 o setSize
public void setSize(int newSize,
                    int row)
Calls the Vector.setSize() on the specified row in dataVector

Parameters:
newSize - The new size
row - The specified row
 o setValueAt
public void setValueAt(Object aValue,
                       int row,
                       int column)
Set the value for a specified cell

Parameters:
aValue - The object value to set the specified cell to. Should be a string for this model.
row - The specified row.
column - The specified column
Overrides:
setValueAt in class AbstractTableModel
 o size
public int size()
Calls the Vector.Size() on dataVector

Returns:
The current size (number of rows) of dataVector.
 o size
public int size(int row)
Calls the Vector.Size() on the specified row in dataVector

Parameters:
row - The specified row
Returns:
The current size of the specified row
 o trimToSize
public void trimToSize(int row)
Calls the Vector.trimToSize() on the specified row in dataVector

Parameters:
row - The specified row

All Packages  Class Hierarchy  This Package  Previous  Next  Index