system
Class ViewPlug

java.lang.Object
  extended by system.ViewPlug

public class ViewPlug
extends java.lang.Object

This class allows access to the system package for viewable classes. It is the systems plug into the CLI and GUI Package.


Field Summary
private static Viewable application
           
private static Bol bol
           
 
Constructor Summary
ViewPlug()
           
 
Method Summary
static void changeDataType(java.lang.Object newDataType, int position)
          Changes the default data type for a particular column.
static void clearData()
          Clears the data from the bol object.
static void deleteColumn(int col)
          Deletes a column at the position selected.
static void deleteRow(int row)
          Deletes a record at the position selected.
static java.util.ArrayList<java.lang.String> getCatalogs()
          Gets the catalogs.
static java.util.ArrayList<java.lang.Object> getClasses()
          Gets the data classes of the Bol2.
static java.util.ArrayList<java.lang.Object> getColumnNames()
           
static boolean getConnection(java.lang.String url, int vendor, java.lang.String user, java.lang.String password)
          Sends through the various parameters needed for the connection.
static java.util.List<java.util.List<java.lang.Object>> getData()
          Gets the data from the bol.
static java.util.ArrayList<java.lang.Object> getDataType()
           
static boolean getDataTypeSingle(java.lang.Object value, int position)
          Get the data type of the string and checks whether it matches the previously set data type.
static java.lang.String getErrors()
          Gets the errors from the error list.
static java.util.ArrayList<java.lang.String> getTables(java.lang.String catalog)
          Gets the databases tables.
static java.lang.String[] getVendors()
          Gets the vendors of supplying DBMS.
static void init(Viewable application)
          Calls the viewable interface method.
static void insertColumn(int pos)
          Inserts a new column at the position selected.
static void insertRow(int pos)
          Inserts a new record at the position selected.
static void modifyCell(int row, int column, java.lang.Object newContent)
          Sets the value of an individual cell.
static void modifyColumnName(int column, java.lang.Object newText)
          Changes the column name.
static boolean populate(java.lang.String fileName, Bol.IOType type)
          Gets the data to be placed into the API.
static boolean saveData(Bol.IOType type, java.lang.String fileName)
           
static boolean sendDataToDBMS(java.lang.String database, java.lang.String tableName)
          Gets the database name and table name.
static void setData(java.util.List<java.util.List<java.lang.Object>> data)
           
static void setDefaultColumnNames()
           
static void update()
          Updates the bol.
static java.util.ArrayList<java.lang.String> writeDataTypes(int colNumber)
          Gets the list of available data types for a column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bol

private static Bol bol

application

private static Viewable application
Constructor Detail

ViewPlug

public ViewPlug()
Method Detail

init

public static void init(Viewable application)
Calls the viewable interface method.

Parameters:
application - the application

populate

public static boolean populate(java.lang.String fileName,
                               Bol.IOType type)
Gets the data to be placed into the API.

Parameters:
fileName - the name of the file to be opened.
type - the type of file the data should be opened as.
Returns:
whether the data has been gotten.

update

public static void update()
Updates the bol.


clearData

public static void clearData()
Clears the data from the bol object.


getData

public static java.util.List<java.util.List<java.lang.Object>> getData()
Gets the data from the bol.

Returns:
the list of

setData

public static void setData(java.util.List<java.util.List<java.lang.Object>> data)
Parameters:
data -

getColumnNames

public static java.util.ArrayList<java.lang.Object> getColumnNames()
Returns:

saveData

public static boolean saveData(Bol.IOType type,
                               java.lang.String fileName)
Parameters:
type -
fileName -
Returns:

setDefaultColumnNames

public static void setDefaultColumnNames()

getDataType

public static java.util.ArrayList<java.lang.Object> getDataType()
Returns:

getDataTypeSingle

public static boolean getDataTypeSingle(java.lang.Object value,
                                        int position)
Get the data type of the string and checks whether it matches the previously set data type.

Parameters:
value - - string sent from user to change for validation check.
position - - position of the data in the arraylist
Returns:
the success of the validation, whether it is acceptable in the data type slot.

getVendors

public static java.lang.String[] getVendors()
Gets the vendors of supplying DBMS.

Returns:
the string array of vendors on the machine.

getConnection

public static boolean getConnection(java.lang.String url,
                                    int vendor,
                                    java.lang.String user,
                                    java.lang.String password)
Sends through the various parameters needed for the connection.

Parameters:
url - the url of the connection stream.
vendor - the vendor of the conection stream.
user - the username of the conection stream.
password - the password of the conection stream.
Returns:
whether the connection was successful.

getTables

public static java.util.ArrayList<java.lang.String> getTables(java.lang.String catalog)
Gets the databases tables.

Parameters:
catalog - the catalogs to get the tables.
Returns:
the arraylist of tables.

getCatalogs

public static java.util.ArrayList<java.lang.String> getCatalogs()
Gets the catalogs.

Returns:
the catalogs arraylist from the Bol2.

sendDataToDBMS

public static boolean sendDataToDBMS(java.lang.String database,
                                     java.lang.String tableName)
Gets the database name and table name.

Parameters:
database - the database name.
tableName - the database table.
Returns:
whether the data was sent successfully.

getClasses

public static java.util.ArrayList<java.lang.Object> getClasses()
Gets the data classes of the Bol2.

Returns:
the arraylist of the classes.

modifyColumnName

public static void modifyColumnName(int column,
                                    java.lang.Object newText)
Changes the column name.

Parameters:
column - the column to have the new name changed.
newText - the new name of the column.

deleteRow

public static void deleteRow(int row)
Deletes a record at the position selected.

Parameters:
row - the position of the new record.

insertRow

public static void insertRow(int pos)
Inserts a new record at the position selected.

Parameters:
pos - the position of the new record.

deleteColumn

public static void deleteColumn(int col)
Deletes a column at the position selected.

Parameters:
col - the position of the new column.

insertColumn

public static void insertColumn(int pos)
Inserts a new column at the position selected.

Parameters:
pos - the position of the new column.

modifyCell

public static void modifyCell(int row,
                              int column,
                              java.lang.Object newContent)
Sets the value of an individual cell.

Parameters:
row - the row position in the table.
column - the column position in the table.
newContent - the new value of the cell.

writeDataTypes

public static java.util.ArrayList<java.lang.String> writeDataTypes(int colNumber)
Gets the list of available data types for a column.

Parameters:
colNumber - position the column's position in the list.
Returns:
the arraylist of available data types for the column.

changeDataType

public static void changeDataType(java.lang.Object newDataType,
                                  int position)
Changes the default data type for a particular column.

Parameters:
newDataType - the new datatype for the column.
position - the column's position in the list.

getErrors

public static java.lang.String getErrors()
Gets the errors from the error list.

Returns:
the error that was generated.