Package adams.gui.scripting
Class ScriptingEngineManager
- java.lang.Object
-
- adams.gui.scripting.ScriptingEngineManager
-
- All Implemented Interfaces:
Serializable
public class ScriptingEngineManager extends Object implements Serializable
Manages the database URL/scripting engine relations.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Hashtable<String,AbstractScriptingEngine>
m_Engines
for storing the engine objects.
-
Constructor Summary
Constructors Constructor Description ScriptingEngineManager()
Initializes the manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractScriptingEngine
add(AbstractDatabaseConnection dbcon, AbstractScriptingEngine engine)
Adds the engine object for the specified database connection.AbstractScriptingEngine
get(AbstractDatabaseConnection dbcon)
Gets the engine object for the specified database connection.protected String
getKey(AbstractDatabaseConnection dbcon)
Returns the key for this database connection.boolean
has(AbstractDatabaseConnection dbcon)
Checks whether a engine object for the specified database connection is available.Iterator<AbstractScriptingEngine>
iterator()
Returns an iterator over all engines.String
toString()
Returns a short string representation of the manager.
-
-
-
Field Detail
-
m_Engines
protected Hashtable<String,AbstractScriptingEngine> m_Engines
for storing the engine objects.
-
-
Method Detail
-
getKey
protected String getKey(AbstractDatabaseConnection dbcon)
Returns the key for this database connection.- Parameters:
dbcon
- the database connection to get a key for- Returns:
- the key
-
has
public boolean has(AbstractDatabaseConnection dbcon)
Checks whether a engine object for the specified database connection is available.- Parameters:
dbcon
- the connection to check- Returns:
- true if a engine object is available
-
get
public AbstractScriptingEngine get(AbstractDatabaseConnection dbcon)
Gets the engine object for the specified database connection.- Parameters:
dbcon
- the connection to get the engine for- Returns:
- the engine object if available, otherwise null
-
add
public AbstractScriptingEngine add(AbstractDatabaseConnection dbcon, AbstractScriptingEngine engine)
Adds the engine object for the specified database connection.- Parameters:
dbcon
- the connection to add the engine forengine
- the engine object to add- Returns:
- the previous engine, null if no previous one stored
-
iterator
public Iterator<AbstractScriptingEngine> iterator()
Returns an iterator over all engines.- Returns:
- the iterator
-
-