|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.engine.EngineTypes
public abstract class EngineTypes
This class is a Mediator that binds the various classes and resources together that belong to an engine implementation. It also contains an enumeration of engine types that are implemented for convenience.
Every Engine
implementation define its corresponding concrete
engine type. The name of an engine type must be unique. If it already exists
for a different instance of EngineTypes
, the constructor will
throw an exception.
Engine types should always be implemented as Singletons.
The name of an engine type also defines the resource directory to be used for
everything related to that engine. Therefore the conventions for variable
names defined in com.jstatcom.model.JSCConstants
are enforced
for engine type names as well.
This class implements the typesave enum pattern (Joshua Bloch,
"Effective Java", Item 21) . If you compare EngineTypes
,
always use the ==
operator.
Field Summary | |
---|---|
java.lang.String |
DIR_NAME
|
static EngineTypes |
GAUSS
Reference to the GAUSS engine type. |
static EngineTypes |
GRTE
Reference to the Gauss Runtime Engine type. |
static EngineTypes |
MATLAB
Reference to the newer Matlab Engine type. |
static EngineTypes |
MLAB
Reference to the older Matlab Engine type. |
java.lang.String |
name
The name of this runtype. |
static EngineTypes |
OX
Reference to the Ox Engine type. |
static EngineTypes |
RSTAT
Reference to the R Engine type. |
static EngineTypes |
STUB
Reference to the Stub Engine type. |
Method Summary | |
---|---|
java.lang.String |
checkConfig(ConfigHolder configHolder)
Checks all configuration data for validity. |
abstract java.lang.String |
checkSettings(ConfigHolder configHolder)
This method should be overwritten by clients, if further checks of the settings have to be specified. |
static java.util.Iterator |
engineIterator()
Gets an iterator over all loaded engines. |
boolean |
equals(java.lang.Object o)
Override prevention method to enforce a.equals(b) if and
only if a==b . |
java.lang.String |
getConfigFile()
Returns the config file location for the respective engine. |
abstract java.util.Map<java.lang.String,ConfigKeys> |
getConfigKeys()
Gets a map with all config keys for that specific engine. |
AbstractConfigPanel |
getConfigPanel()
Gets the configuration panel for the respective engine. |
abstract Engine |
getEngine()
Gets a concrete implementation of the Engine interface. |
int |
hashCode()
Override prevention method invokes super method. |
java.lang.String |
toString()
Returns a string that represents the value of this object. |
static EngineTypes |
valueOf(java.lang.String name)
Gets the type for the given name. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.lang.String name
public final java.lang.String DIR_NAME
public static final EngineTypes GAUSS
public static final EngineTypes GRTE
public static final EngineTypes STUB
public static final EngineTypes MATLAB
public static final EngineTypes RSTAT
public static final EngineTypes MLAB
public static final EngineTypes OX
Method Detail |
---|
public final java.lang.String checkConfig(ConfigHolder configHolder)
ConfigKeys
are ok
public String checkSettings()
It is called from this method after all other checks succeeded and can be used to validate conditions between engine settings.
configHolder
- the config settings to check
null
if ok, error string otherwise
java.lang.IllegalArgumentException
- if (configHolder == null)
public abstract java.lang.String checkSettings(ConfigHolder configHolder)
configHolder
- the config settings to check
null
if ok, error string otherwisepublic final boolean equals(java.lang.Object o)
a.equals(b)
if and
only if a==b
.
equals
in class java.lang.Object
o
- object to compare with
true
if equal, false
otherwisepublic java.lang.String getConfigFile()
"j" + name.toLowerCase() + "/" + CONFIG_FILE;
If the directory "j" + name.toLowerCase()
does not exist
yet in the resource path, it will be created by this method.
Subclasses can overwrite this method if this is not the desired behaviour.
public abstract java.util.Map<java.lang.String,ConfigKeys> getConfigKeys()
Example:
Implementations of a Foo
engine this class could use:
return ConfigKeys.getAllKeys(FooConfigKeys.class);
where Foo
stands for the name of the engine and
FooConfigKeys
is the engine specific implementation of
ConfigKeys
.
Map
containing the ConfigKeys
with
the respective names as keyspublic AbstractConfigPanel getConfigPanel()
public abstract Engine getEngine()
Engine
interface.
public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object
this
public static EngineTypes valueOf(java.lang.String name)
name
makes
no difference.
name
- the name of the type
EngineTypes
with
name
or null
if it does not exist
java.lang.IllegalArgumentException
- if (name == null)
public static java.util.Iterator engineIterator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |