|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel org.bibalex.daf.handlers.dbhandler.DataTable
public class DataTable
Represents an in memory database table.
Field Summary | |
---|---|
private java.util.Vector<java.lang.String> |
columnNames
Holds the names of the columns |
private static java.util.ArrayList<java.lang.Integer> |
DynamicColumnIndices
|
private java.util.Vector<java.lang.Object> |
table
Holds the table of the data |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
DataTable()
Creates a new DataTable with empty column names and no data. |
|
DataTable(DataTable dataTable)
Copy Constructor |
|
DataTable(int columns)
Creates a new DataTable with the specifeid number of columns and empty data. |
|
DataTable(java.sql.ResultSet result)
Creates a new DataTable based on the given result set. |
Method Summary | |
---|---|
void |
addRow(DataTable row)
Adds a data table row to the table. |
void |
addRow(java.lang.Object[] row)
Adds a row to the table. |
void |
addRowAt(DataTable row,
int index)
Adds a row to the table with index. |
void |
addRowAt(java.lang.Object[] row,
int index)
Adds a row to the table with index. |
void |
deleteRow(int rowIndex)
Deletes the row at the specified index. |
java.lang.Object |
elementAt(int row,
int column)
Gets the element at the specified row and column. |
java.lang.Object |
elementAt(int row,
java.lang.String columnName)
Gets the element at the specified row and column. |
static void |
ExportToExcel(DataTable model)
Exports the table to excel sheet |
int |
getColumnCount()
|
java.lang.String |
getColumnName(int column)
|
static java.util.ArrayList |
getDynamicColumnIndices()
|
java.lang.String |
getNameOfColumn(int column)
Gets the column name. |
int |
getNoOfColumns()
Gets the number of columns in the DataTable. |
int |
getNoOfRows()
Gets the number of rows in the DataTable. |
DataTable |
getRow(int index)
Retrieves the row from the dataTable for the selected index |
int |
getRowCount()
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
|
DataTable |
setArchivingMatrix(DataTable dataTable,
DataTable columnDataTable)
|
static void |
setDynamicColumnIndices(java.util.ArrayList<java.lang.Integer> indices)
|
DataTable |
setDynamicTable(DataTable dataTable,
DataTable columnDataTable,
int[] usersIDs,
java.lang.String[] usersNames)
|
void |
setNameOfColumn(int column,
java.lang.String name)
Sets the column name. |
void |
setNoOfColumn(int size)
Sets the number of columns in the DataTable. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
Set the value of an object in the data table given the row and col |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector<java.lang.Object> table
private java.util.Vector<java.lang.String> columnNames
private static java.util.ArrayList<java.lang.Integer> DynamicColumnIndices
Constructor Detail |
---|
public DataTable()
public DataTable(DataTable dataTable)
dataTable
- The DataTable to copy.public DataTable(int columns)
columns
- The number of columns in the DataTable.public DataTable(java.sql.ResultSet result)
result
- A result set used to populate the DataTable.Method Detail |
---|
public void setNoOfColumn(int size)
size
- The number of columns.public DataTable setDynamicTable(DataTable dataTable, DataTable columnDataTable, int[] usersIDs, java.lang.String[] usersNames)
public DataTable setArchivingMatrix(DataTable dataTable, DataTable columnDataTable)
public int getNoOfColumns()
public static java.util.ArrayList getDynamicColumnIndices()
public int getNoOfRows()
public void setNameOfColumn(int column, java.lang.String name)
column
- The column index (0 - based).name
- The name of the column.public java.lang.String getNameOfColumn(int column)
column
- The column index (0 - based).
public void addRow(java.lang.Object[] row)
row
- An array holding the values to be added.public void addRow(DataTable row)
row
- a data table row.public void addRowAt(DataTable row, int index)
row
- a DataTable to be added.index
- is the location of the rowpublic void addRowAt(java.lang.Object[] row, int index)
row
- An array holding the values to be added.index
- is the location of the rowpublic void deleteRow(int rowIndex)
rowIndex
- The index of the row to delete.public java.lang.Object elementAt(int row, int column)
row
- The row index (0 - based).column
- The column index (0 - based).
public java.lang.Object elementAt(int row, java.lang.String columnName)
row
- The row index (0 - based).columnName
- The column name.
public int getRowCount()
public int getColumnCount()
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public void setValueAt(java.lang.Object value, int row, int col)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
value
- The value to be setrow
- The row index (0 - based).col
- The column index.public DataTable getRow(int index)
index
- the row to retreive
public static void ExportToExcel(DataTable model)
model
- The DataTable to export to excel.public static void setDynamicColumnIndices(java.util.ArrayList<java.lang.Integer> indices)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |