com.jstatcom.engine
Class ConfigKeys
- java.lang.Object
-
- com.jstatcom.engine.ConfigKeys
-
- Direct Known Subclasses:
- GaussConfigKeys, GRTEConfigKeys, MatlabConfigKeys, MLabConfigKeys, OxConfigKeys, StubMlabConfigKeys
public abstract class ConfigKeys extends java.lang.ObjectThis class contains an enumeration of constants that define different types of information needed for a certain engine to run, for example the location of the executable, the temporary directory, etc. This class needs to be subclassed to define the necessary constants for a certain engine.It implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21) . If you compare
ConfigKeys, always use the==operator.
-
-
Constructor Summary
Constructors Constructor and Description ConfigKeys(java.lang.String name)Creates a new config key.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract java.lang.StringdefaultVal()Gets the default value for this config key.booleanequals(java.lang.Object o)Override prevention method to enforcea.equals(b)if and onlyif a==b.static java.util.Map<java.lang.String,ConfigKeys>getAllKeys(java.lang.Class c)Gets a map of all public keys defined in classc.inthashCode()Override prevention method invokes super method.abstract java.lang.StringisValid(java.lang.String value)Gets whethervalueis valid forthis.java.lang.Stringname()Gets the name ofthis.java.lang.StringtoString()Gets a string representation.
-
-
-
Constructor Detail
-
ConfigKeys
public ConfigKeys(java.lang.String name)
Creates a new config key.- Parameters:
name- the identifier of the new key- Throws:
java.lang.IllegalArgumentException-if (name == null)
-
-
Method Detail
-
defaultVal
public abstract java.lang.String defaultVal()
Gets the default value for this config key. If no reasonable defaul exists for that setting, this method should return an empty string.- Returns:
- string with default setting or
""if no reasonable default exists
-
equals
public final boolean equals(java.lang.Object o)
Override prevention method to enforcea.equals(b)if and onlyif a==b.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- object to compare with- Returns:
trueif equal,falseotherwise
-
getAllKeys
public static java.util.Map<java.lang.String,ConfigKeys> getAllKeys(java.lang.Class c)
Gets a map of all public keys defined in classc. All key objects are stored with its name as the respective key.- Returns:
- the config keys map
- Throws:
java.lang.IllegalArgumentException-if (c.getSuperclass() != ConfigKeys.class)orif (c == null)
-
hashCode
public final int hashCode()
Override prevention method invokes super method.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hash code
-
isValid
public abstract java.lang.String isValid(java.lang.String value)
Gets whethervalueis valid forthis.- Parameters:
value- a string value for this key- Returns:
nullif valid, an error string if not valid
-
name
public final java.lang.String name()
Gets the name ofthis.- Returns:
- the name of the key
-
toString
public final java.lang.String toString()
Gets a string representation.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of
this
-
-
DMelt 3.0 © DataMelt by jWork.ORG