|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<ParameterTypeEnum>
com.apama.services.scenario.ParameterTypeEnum
public enum ParameterTypeEnum
Enum class to model the "type" of scenario input/output parameters.
There are several type structures used when dealing with scenarios:
Java types, MonitorScript types, and a kind of extension to MonitorScript
types that are used within ScenarioManager to add support for enumerations.
The point of this class to ease development of code that must deal with
these types and conversions between them. Note that the Scenario enumeration
type is modelled as a string
in MonitorScript, and a java.lang.String
in
Java.
The following table shows the relationship between these type systems.
ScenarioManager GUI | Scenario Type | MonitorScript Type | Java Type |
Text | string | string | java.lang.String |
Whole Number | integer | integer | java.lang.Long |
Number | float | float | java.lang.Double |
? | ? | ............decimal | DecimalFieldValue | .
True/False | boolean | boolean | java.lang.Boolean |
Choice | enumeration | string | java.lang.String |
In releases prior to Apama 3.0, this was a class in the form of the standard type-safe enum pattern, but has been upgraded to a new style Java enum once the Java 5 language features were permitted in our code-base.
Enum Constant Summary | |
---|---|
BOOLEAN
Scenario boolean, MonitorScript boolean, Java Boolean, ScenarioManager GUI True/False. |
|
DECIMAL
Scenario decimal, MonitorScript decimal, Java Big Decimal, ScenarioManager GUI decimal. |
|
ENUMERATION
Scenario enumeration, MonitorScript string, Java String, ScenarioManager GUI Choice. |
|
FLOAT
Scenario float, MonitorScript float, Java Double, ScenarioManager GUI Number. |
|
INTEGER
Scenario integer, MonitorScript integer, Java Long, ScenarioManager GUI Whole Number. |
|
STRING
Scenario string, MonitorScript string, Java String, ScenarioManager GUI Text. |
Method Summary | |
---|---|
static boolean |
canDecodeString(java.lang.String value,
ParameterTypeEnum paramType)
Utility method to check whether a string representation of a parameter value (in the format used by the Correlator) can be converted to a Java object, based on its type identifier. |
static java.lang.Object |
decodeString(java.lang.String value,
ParameterTypeEnum paramType)
Utility method to convert the EPL string representation of a parameter value to a Java object, based on its type identifier. |
static ParameterTypeEnum |
fromScenarioType(java.lang.String stype)
Static utility method to determine the enum value from the scenario version of a type. |
java.lang.Class<?> |
getJavaType()
Get the Java type (class) that is used to represent parameters of this type. |
java.lang.String |
getMonitorScriptType()
Get the MonitorScript type that is used internally within the correlator for variable of this type. |
java.lang.String |
getScenarioType()
Get the type as defined in the Scenario definition file (sdf), and which is also returned from the correlator. |
java.lang.String |
toString()
Override the toString() method of the Object class to return the scenario type. |
static ParameterTypeEnum |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static ParameterTypeEnum[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final ParameterTypeEnum STRING
public static final ParameterTypeEnum INTEGER
public static final ParameterTypeEnum FLOAT
public static final ParameterTypeEnum DECIMAL
public static final ParameterTypeEnum BOOLEAN
public static final ParameterTypeEnum ENUMERATION
Method Detail |
---|
public static ParameterTypeEnum[] values()
for (ParameterTypeEnum c : ParameterTypeEnum.values()) System.out.println(c);
public static ParameterTypeEnum valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic java.lang.String getScenarioType()
public java.lang.String getMonitorScriptType()
public java.lang.Class<?> getJavaType()
public java.lang.String toString()
getScenarioType()
.
toString
in class java.lang.Enum<ParameterTypeEnum>
public static ParameterTypeEnum fromScenarioType(java.lang.String stype) throws ScenarioServiceException
ScenarioServiceException
- if the parameter does not represent a valid type.public static java.lang.Object decodeString(java.lang.String value, ParameterTypeEnum paramType)
EventParser
package for more classes to format and parse EPL strings). User interface code should normally use user-friendly
locale-sensitive parsing methods instead.
If the value cannot be parsed, a warning is logged and a default value is returned; this method should not throw exceptions.
value
- the stringified value to be decoded, in the format used by the Apama EPL.paramType
- the type identifier to indicate which type to convert to.
public static boolean canDecodeString(java.lang.String value, ParameterTypeEnum paramType)
value
- the stringified value to be decoded, in the format used by the Apama Correlator.paramType
- the type identifier to indicate which type to convert to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |