org.opentox.interfaces
Interface ITable

All Known Implementing Classes:
ModelsTable, TaskTable, UsersTable

public interface ITable

A Table in the databse of the server. The structure of the table (number of columns, datatype of each column etc) are specified once the table is created which is done by the method create(). This interface provides useful methods for handling database tables.

Author:
Sopasakis Pantelis

Method Summary
 void create()
          Creates the table.
 void getRidOf()
          Removes completely the table from the database.
 Jterator<java.lang.String> iterator(java.lang.String ColumnName)
          Provides an iterator for all elements in a specified column of the database.
 Jterator<java.lang.String> search(java.lang.String IterableCoumn, java.lang.String SearchColumn, java.lang.String keyword)
          Performs a search in the table.
 

Method Detail

getRidOf

void getRidOf()
Removes completely the table from the database. After this operation all data stored in the table will get lost, so make sure that you either really don't need these data or that you have kept backup of your database which is in general highly recommended.


iterator

Jterator<java.lang.String> iterator(java.lang.String ColumnName)
Provides an iterator for all elements in a specified column of the database.

Parameters:
ColumnName - The name of the column.
Returns:
An instance of Jterator<String>

search

Jterator<java.lang.String> search(java.lang.String IterableCoumn,
                                  java.lang.String SearchColumn,
                                  java.lang.String keyword)
Performs a search in the table. Searches the entries of the column defined by SearchColumn to check if its entries resemble a given keyword and returns an iterator over the corresponding entries of the column specified by the argument IterableColumn. The search is performed by a database SQL-type query containing 'LIKE %...%'.

Parameters:
IterableCoumn - The column of the table on whose entries the iterator takes values.
SearchColumn - The column of the table which should be searched.
keyword - A keyword
Returns:
An instance of a Jterator (in fact this is an Iterator) which can be used to iterate over the search results.

create

void create()
Creates the table.