appli.sqlplayer.util
Class SqlCommands

java.lang.Object
  extended byappli.sqlplayer.util.SqlCommands

public class SqlCommands
extends java.lang.Object

Contains the list of available sql commands

Version:
1.0 June 2003
2.0 July 2003 (SJ) : ajout d'un constructeur avec un ArrayList + methode getPartSqlCommands(String categorie) pour recuperer les commandes d'une categorie
Author:
Marc Wenger/CDS, Sylvaine Jaehn

Field Summary
private  Parameters psql
           
private  java.util.ArrayList sqlCommands
           
private  java.lang.String sqlFilename
           
 
Constructor Summary
SqlCommands()
          Empty constructor
SqlCommands(java.util.ArrayList sqlCommands)
          Constructor.
SqlCommands(java.lang.String filename)
          Constructor from a file
 
Method Summary
 java.util.ArrayList getPartSqlCommands(java.lang.String category)
          Get the SQL commands defined in a specific category
 int getSize()
          Get the number of SQL commands in the list
 Sqlcmd getSql(int position)
          Get the SQL Command at a specific position.
 Sqlcmd getSql(java.lang.String name)
          Get the SQL Command by its name
 java.lang.String getSqlFilename()
          Get the sql commands filename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sqlFilename

private java.lang.String sqlFilename

psql

private Parameters psql

sqlCommands

private java.util.ArrayList sqlCommands
Constructor Detail

SqlCommands

public SqlCommands()
Empty constructor


SqlCommands

public SqlCommands(java.lang.String filename)
Constructor from a file

Parameters:
filename - name of the file containing the sql commands

SqlCommands

public SqlCommands(java.util.ArrayList sqlCommands)
Constructor. Builds a SqlCommands object from an commands array list. Is used with an ArrayList returned by getPartSqlCommands

Parameters:
sqlCommands - ArrayList of SqlCommands
Method Detail

getSqlFilename

public java.lang.String getSqlFilename()
Get the sql commands filename

Returns:
Filename of SQL File

getSize

public int getSize()
Get the number of SQL commands in the list

Returns:
number of SQL statements

getSql

public Sqlcmd getSql(int position)
Get the SQL Command at a specific position.

Parameters:
position - defines which SQL command to return
Returns:
SQL Command as String

getSql

public Sqlcmd getSql(java.lang.String name)
Get the SQL Command by its name

Parameters:
name - name of the command
Returns:
the SqlCmd object (or null if the command was not found)

getPartSqlCommands

public java.util.ArrayList getPartSqlCommands(java.lang.String category)
Get the SQL commands defined in a specific category

Parameters:
category - full name of the category
Returns:
the ArrayList of the selected sql commands. It can be used to create another SqlCommands object with a constructor.