|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cmu.survey.data.TableStorageStub<DTM>
public abstract class TableStorageStub<DTM extends DataTableModel>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface cmu.survey.data.TableStorage |
---|
TableStorage.SearchingForConnectionListener, TableStorage.TableListListener |
Field Summary | |
---|---|
protected java.lang.String |
lastErrorMessage
|
protected java.util.Vector<TableStorage.SearchingForConnectionListener> |
searchingForConnectionListeners
|
protected java.util.Vector<TableStorage.TableListListener> |
tableListListeners
|
protected TableVersionStorage |
tableVersionStorage
|
Constructor Summary | |
---|---|
TableStorageStub()
|
Method Summary | |
---|---|
void |
addSearchingForConnectionListener(TableStorage.SearchingForConnectionListener listener)
Add a listener to find when TableStorage is unavailable (usually due to network issues). |
void |
addTableListListener(TableStorage.TableListListener listener)
|
void |
close()
Closes all the DataTableModels that have been opened. |
boolean |
deleteTable(java.lang.String tableName)
For convenience, this returns the DataTableModel passed into it and checks for null. |
protected abstract boolean |
deleteTableProtected(java.lang.String tableName)
|
void |
finalize()
|
protected void |
fireTableListChanged()
|
java.lang.String |
getLastErrorMessage()
Returns an error message, if there was one, from the most recent error. |
protected abstract DataTableModelSingularInfo<DTM> |
getSingularInfo(java.lang.String tableName)
|
protected abstract DataTableModelSingularInfo<DTM> |
getSingularInfo(TableFormat tableFormat)
|
DataTableModel |
getTable(java.lang.String tableName)
Get the table so named. |
DataTableModel |
getTable(TableFormat tableFormat)
Gets the table with that format. |
protected abstract DTM |
getTableProtected(DataTableModelSingularInfo singularInfo)
|
TableVersionStorage |
getTableVersionStorage()
|
protected DTM |
newTable(DataTableModelSingularInfo<DTM> singularInfo)
|
DataTableModel |
newTable(java.lang.String tableName,
java.util.List<java.lang.String> columnNames,
java.util.List<java.lang.Class> columnTypes)
|
DataTableModel |
newTable(java.lang.String tableName,
java.util.List<java.lang.String> columnNames,
java.util.List<java.lang.Class> columnTypes,
java.lang.Integer primaryKeyColumn)
Returns a new table, or null if it fails. |
DataTableModel |
newTable(java.lang.String tableName,
java.util.List<java.lang.String> columnNames,
java.util.List<java.lang.Class> columnTypes,
java.util.List<java.lang.Boolean> columnAllowsNull,
java.util.List<java.lang.Object> columnDefaultValues,
java.lang.Integer primaryKeyColumn)
Creates a new table in the database, and returns it, or null if it fails. |
protected abstract DTM |
newTable(java.lang.String tableName,
java.util.List<java.lang.String> columnNames,
java.util.List<java.lang.Class> columnTypes,
java.util.List<java.lang.Boolean> columnAllowsNull,
java.util.List<java.lang.Object> columnDefaultValues,
java.lang.Integer primaryKeyColumn,
DataTableModelSingularInfo<DTM> tableInfo)
|
DataTableModel |
newTable(java.lang.String tableName,
java.lang.String[] columnNames,
java.lang.Class[] columnTypes)
|
DataTableModel |
newTable(java.lang.String tableName,
java.lang.String[] columnNames,
java.lang.Class[] columnTypes,
java.lang.Integer primaryKeyColumn)
|
DataTableModel |
newTable(TableFormat tableFormat)
|
void |
removeSearchingForConnectionListener(TableStorage.SearchingForConnectionListener listener)
Removes a listener to find when TableStorage is unavailable (usually due to network issues). |
void |
removeTableListListener(TableStorage.TableListListener listener)
|
boolean |
renameTable(java.lang.String oldTableName,
java.lang.String newTableName)
|
protected abstract boolean |
renameTableProtected(java.lang.String oldTableName,
java.lang.String newTableName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cmu.survey.data.TableStorage |
---|
cancelSearchingForConnection, getTableNames, isOpen, isTableNamesCaseSensitive, isValidLabelString, tableExists |
Field Detail |
---|
protected java.lang.String lastErrorMessage
protected TableVersionStorage tableVersionStorage
protected java.util.Vector<TableStorage.SearchingForConnectionListener> searchingForConnectionListeners
protected java.util.Vector<TableStorage.TableListListener> tableListListeners
Constructor Detail |
---|
public TableStorageStub()
Method Detail |
---|
public DataTableModel newTable(TableFormat tableFormat)
newTable
in interface TableStorage
newTable(String, List, List, List, List, int);
protected DTM newTable(DataTableModelSingularInfo<DTM> singularInfo)
public TableVersionStorage getTableVersionStorage()
public java.lang.String getLastErrorMessage()
TableStorage
getLastErrorMessage
in interface TableStorage
public DataTableModel newTable(java.lang.String tableName, java.util.List<java.lang.String> columnNames, java.util.List<java.lang.Class> columnTypes)
newTable
in interface TableStorage
newTable(String, List, List, List, List, int);
public DataTableModel newTable(java.lang.String tableName, java.lang.String[] columnNames, java.lang.Class[] columnTypes)
newTable
in interface TableStorage
newTable(String, List, List, List, List, int);
public DataTableModel newTable(java.lang.String tableName, java.lang.String[] columnNames, java.lang.Class[] columnTypes, java.lang.Integer primaryKeyColumn)
newTable
in interface TableStorage
newTable(String, List, List, List, List, int);
public DataTableModel newTable(java.lang.String tableName, java.util.List<java.lang.String> columnNames, java.util.List<java.lang.Class> columnTypes, java.lang.Integer primaryKeyColumn)
newTable
in interface TableStorage
tableName
- columnNames
- A Vector of String of the names of each columncolumnTypes
- A Vector of Class with the types of each column -- must be the
same size() as columnNames.primaryKeyColumn
- An index into columnNames with the primary key column. If
there is no primary key, it should be -1. If the primary key
column is an Integer, it will also be made as an
auto_increment column.
newTable(String, List, List, List, List, int);
public DataTableModel newTable(java.lang.String tableName, java.util.List<java.lang.String> columnNames, java.util.List<java.lang.Class> columnTypes, java.util.List<java.lang.Boolean> columnAllowsNull, java.util.List<java.lang.Object> columnDefaultValues, java.lang.Integer primaryKeyColumn)
TableStorage
newTable
in interface TableStorage
columnNames
- A Vector of String of the names of each columncolumnTypes
- A Vector of Class with the types of each column -- must be the
same size() as columnNames.columnAllowsNull
- (optional)
A Vector of Boolean as to whether or not the column allows null as a value.columnDefaultValues
- (optional)
A Vector of Object, for the default value in each column when it's there.primaryKeyColumn
- (optional, -1 if none)
An index into columnNames with the primary key column. If
there is no primary key, it should be -1. If the primary key
column is an Integer, it will also be made as an auto-incrementing
column.
protected abstract DTM newTable(java.lang.String tableName, java.util.List<java.lang.String> columnNames, java.util.List<java.lang.Class> columnTypes, java.util.List<java.lang.Boolean> columnAllowsNull, java.util.List<java.lang.Object> columnDefaultValues, java.lang.Integer primaryKeyColumn, DataTableModelSingularInfo<DTM> tableInfo)
public DataTableModel getTable(java.lang.String tableName)
TableStorage
getTable
in interface TableStorage
public DataTableModel getTable(TableFormat tableFormat)
TableStorage
getTable
in interface TableStorage
tableFormat
- format the table should be in
protected abstract DataTableModelSingularInfo<DTM> getSingularInfo(java.lang.String tableName)
protected abstract DataTableModelSingularInfo<DTM> getSingularInfo(TableFormat tableFormat)
protected abstract DTM getTableProtected(DataTableModelSingularInfo singularInfo)
public boolean deleteTable(java.lang.String tableName)
deleteTable
in interface TableStorage
tableName
- dataTableModel
-
protected abstract boolean deleteTableProtected(java.lang.String tableName)
public boolean renameTable(java.lang.String oldTableName, java.lang.String newTableName)
renameTable
in interface TableStorage
protected abstract boolean renameTableProtected(java.lang.String oldTableName, java.lang.String newTableName)
public void addSearchingForConnectionListener(TableStorage.SearchingForConnectionListener listener)
TableStorage
addSearchingForConnectionListener
in interface TableStorage
public void removeSearchingForConnectionListener(TableStorage.SearchingForConnectionListener listener)
TableStorage
removeSearchingForConnectionListener
in interface TableStorage
public void addTableListListener(TableStorage.TableListListener listener)
addTableListListener
in interface TableStorage
public void removeTableListListener(TableStorage.TableListListener listener)
removeTableListListener
in interface TableStorage
protected void fireTableListChanged()
public void close()
close
in interface TableStorage
public void finalize()
finalize
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |