org.qtitools.qti.node.expression
Enum ExpressionType

java.lang.Object
  extended by java.lang.Enum<ExpressionType>
      extended by org.qtitools.qti.node.expression.ExpressionType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ExpressionType>

public enum ExpressionType
extends java.lang.Enum<ExpressionType>

This class creates all supported expressions from given CLASS_TAG.

Supported expressions: and, anyN, baseValue, containerSize, contains, correct, customOperator, default, delete, divide, durationGTE, durationLT, equal, equalRounded, fieldValue, gt, gte, index, inside, integerDivide, integerModulus, integerToFloat, isNull, lt, lte, mapResponse, mapResponsePoint, match, member, multiple, not, null, numberCorrect, numberIncorrect, numberPresented, numberResponded, numberSelected, or, ordered, outcomeMaximum, outcomeMinimum, patternMatch, power, product, random, randomFloat, randomInteger, round, stringMatch, substring, subtract, sum, testVariables, truncate, variable, customOperator, mapResponse, mapResponsePoint.

Additional expressions: randomFloatEx, randomIntegerEx, randomEx, recordEx

Author:
Jiri Kajaba, Jonathon Hare

Enum Constant Summary
AND
          Creates and expression.
ANY_N
          Creates anyN expression.
BASE_VALUE
          Creates baseValue expression.
CONTAINER_SIZE
          Creates containerSize expression.
CONTAINS
          Creates contains expression.
CORRECT
          Creates correct expression.
CUSTOM_OPERATOR
          Creates correct expression.
DEFAULT
          Creates default expression.
DELETE
          Creates delete expression.
DIVIDE
          Creates divide expression.
DURATION_GTE
          Creates durationGTE expression.
DURATION_LT
          Creates durationLT expression.
EQUAL
          Creates equal expression.
EQUAL_ROUNDED
          Creates equalRounded expression.
FIELD_VALUE
          Creates fieldValue expression.
GT
          Creates gt expression.
GTE
          Creates gte expression.
INDEX
          Creates index expression.
INSIDE
          Creates inside expression.
INTEGER_DIVIDE
          Creates integerDivide expression.
INTEGER_MODULUS
          Creates integerModulus expression.
INTEGER_TO_FLOAT
          Creates integerToFloat expression.
IS_NULL
          Creates isNull expression.
LT
          Creates lt expression.
LTE
          Creates lte expression.
MAP_RESPONSE
          Creates mapResponse expression.
MAP_RESPONSE_POINT
          Creates mapResponsePoint expression.
MATCH
          Creates match expression.
MEMBER
          Creates member expression.
MULTIPLE
          Creates multiple expression.
NOT
          Creates not expression.
NULL
          Creates null expression.
NUMBER_CORRECT
          Creates numberCorrect expression.
NUMBER_INCORRECT
          Creates numberIncorrect expression.
NUMBER_PRESENTED
          Creates numberPresented expression.
NUMBER_RESPONDED
          Creates numberResponded expression.
NUMBER_SELECTED
          Creates numberSelected expression.
OR
          Creates or expression.
ORDERED
          Creates ordered expression.
OUTCOME_MAXIMUM
          Creates outcomeMaximum expression.
OUTCOME_MINIMUM
          Creates outcomeMinimum expression.
PATTERN_MATCH
          Creates patternMatch expression.
POWER
          Creates power expression.
PRODUCT
          Creates product expression.
RANDOM
          Creates random expression.
RANDOM_EX
          Creates randomEx expression.
RANDOM_FLOAT
          Creates randomFloat expression.
RANDOM_FLOAT_EX
          Creates randomFloatEx expression.
RANDOM_INTEGER
          Creates randomInteger expression.
RANDOM_INTEGER_EX
          Creates randomIntegerEx expression.
RECORD_EX
          Creates recordEx expression.
ROUND
          Creates round expression.
STRING_MATCH
          Creates stringMatch expression.
SUBSTRING
          Creates substring expression.
SUBTRACT
          Creates subtract expression.
SUM
          Creates sum expression.
TEST_VARIABLES
          Creates testVariables expression.
TRUNCATE
          Creates truncate expression.
VARIABLE
          Creates variable expression.
 
Method Summary
abstract  Expression create(ExpressionParent parent)
          Creates expression.
 java.lang.String getClassTag()
          Gets CLASS_TAG of this expression type.
static Expression getInstance(ExpressionParent parent, java.lang.String classTag)
          Creates expression.
 java.lang.Integer getMaximum()
          Gets maximum allowed children or null.
 java.lang.Integer getMinimum()
          Gets minimum required children or null.
 BaseType[] getProducedBaseTypes()
          Gets list of all produced baseTypes.
 Cardinality[] getProducedCardinalities()
          Gets list of all produced cardinalities.
 BaseType[] getRequiredBaseTypes(int index)
          Gets list of all acceptable baseTypes for given position.
 Cardinality[] getRequiredCardinalities(int index)
          Gets list of all acceptable cardinalities for given position.
static ExpressionType[] getSupportedTypes(Cardinality[] requiredCardinalities, BaseType[] requiredBaseTypes)
          Gets all supported expression types for given requirements.
static ExpressionType getType(java.lang.String classTag)
          Gets expression type for given CLASS_TAG.
 java.lang.String toString()
           
static ExpressionType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ExpressionType[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AND

public static final ExpressionType AND
Creates and expression.

See Also:
And

ANY_N

public static final ExpressionType ANY_N
Creates anyN expression.

See Also:
AnyN

BASE_VALUE

public static final ExpressionType BASE_VALUE
Creates baseValue expression.

See Also:
BaseValue

CONTAINER_SIZE

public static final ExpressionType CONTAINER_SIZE
Creates containerSize expression.

See Also:
ContainerSize

CONTAINS

public static final ExpressionType CONTAINS
Creates contains expression.

See Also:
Contains

CORRECT

public static final ExpressionType CORRECT
Creates correct expression.

See Also:
Correct

CUSTOM_OPERATOR

public static final ExpressionType CUSTOM_OPERATOR
Creates correct expression.

See Also:
Correct

DEFAULT

public static final ExpressionType DEFAULT
Creates default expression.

See Also:
Default

DELETE

public static final ExpressionType DELETE
Creates delete expression.

See Also:
Delete

DIVIDE

public static final ExpressionType DIVIDE
Creates divide expression.

See Also:
Divide

DURATION_GTE

public static final ExpressionType DURATION_GTE
Creates durationGTE expression.

See Also:
DurationGte

DURATION_LT

public static final ExpressionType DURATION_LT
Creates durationLT expression.

See Also:
DurationLt

EQUAL

public static final ExpressionType EQUAL
Creates equal expression.

See Also:
Equal

EQUAL_ROUNDED

public static final ExpressionType EQUAL_ROUNDED
Creates equalRounded expression.

See Also:
EqualRounded

FIELD_VALUE

public static final ExpressionType FIELD_VALUE
Creates fieldValue expression.

See Also:
FieldValue

GT

public static final ExpressionType GT
Creates gt expression.

See Also:
Gt

GTE

public static final ExpressionType GTE
Creates gte expression.

See Also:
Gte

INDEX

public static final ExpressionType INDEX
Creates index expression.

See Also:
Index

INSIDE

public static final ExpressionType INSIDE
Creates inside expression.

See Also:
Inside

INTEGER_DIVIDE

public static final ExpressionType INTEGER_DIVIDE
Creates integerDivide expression.

See Also:
IntegerDivide

INTEGER_MODULUS

public static final ExpressionType INTEGER_MODULUS
Creates integerModulus expression.

See Also:
IntegerModulus

INTEGER_TO_FLOAT

public static final ExpressionType INTEGER_TO_FLOAT
Creates integerToFloat expression.

See Also:
IntegerToFloat

IS_NULL

public static final ExpressionType IS_NULL
Creates isNull expression.

See Also:
IsNull

LT

public static final ExpressionType LT
Creates lt expression.

See Also:
Lt

LTE

public static final ExpressionType LTE
Creates lte expression.

See Also:
Lte

MAP_RESPONSE

public static final ExpressionType MAP_RESPONSE
Creates mapResponse expression.

See Also:
MapResponse

MAP_RESPONSE_POINT

public static final ExpressionType MAP_RESPONSE_POINT
Creates mapResponsePoint expression.

See Also:
MapResponsePoint

MATCH

public static final ExpressionType MATCH
Creates match expression.

See Also:
Match

MEMBER

public static final ExpressionType MEMBER
Creates member expression.

See Also:
Member

MULTIPLE

public static final ExpressionType MULTIPLE
Creates multiple expression.

See Also:
Multiple

NOT

public static final ExpressionType NOT
Creates not expression.

See Also:
Not

NULL

public static final ExpressionType NULL
Creates null expression.

See Also:
Null

NUMBER_CORRECT

public static final ExpressionType NUMBER_CORRECT
Creates numberCorrect expression.

See Also:
NumberCorrect

NUMBER_INCORRECT

public static final ExpressionType NUMBER_INCORRECT
Creates numberIncorrect expression.

See Also:
NumberIncorrect

NUMBER_PRESENTED

public static final ExpressionType NUMBER_PRESENTED
Creates numberPresented expression.

See Also:
NumberPresented

NUMBER_RESPONDED

public static final ExpressionType NUMBER_RESPONDED
Creates numberResponded expression.

See Also:
NumberResponded

NUMBER_SELECTED

public static final ExpressionType NUMBER_SELECTED
Creates numberSelected expression.

See Also:
NumberSelected

OR

public static final ExpressionType OR
Creates or expression.

See Also:
Or

OUTCOME_MAXIMUM

public static final ExpressionType OUTCOME_MAXIMUM
Creates outcomeMaximum expression.

See Also:
OutcomeMaximum

OUTCOME_MINIMUM

public static final ExpressionType OUTCOME_MINIMUM
Creates outcomeMinimum expression.

See Also:
OutcomeMinimum

ORDERED

public static final ExpressionType ORDERED
Creates ordered expression.

See Also:
Ordered

PATTERN_MATCH

public static final ExpressionType PATTERN_MATCH
Creates patternMatch expression.

See Also:
PatternMatch

POWER

public static final ExpressionType POWER
Creates power expression.

See Also:
Power

PRODUCT

public static final ExpressionType PRODUCT
Creates product expression.

See Also:
Product

RANDOM

public static final ExpressionType RANDOM
Creates random expression.

See Also:
Random

RANDOM_EX

public static final ExpressionType RANDOM_EX
Creates randomEx expression.

See Also:
RandomEx

RANDOM_FLOAT

public static final ExpressionType RANDOM_FLOAT
Creates randomFloat expression.

See Also:
RandomFloat

RANDOM_FLOAT_EX

public static final ExpressionType RANDOM_FLOAT_EX
Creates randomFloatEx expression.

See Also:
RandomFloatEx

RANDOM_INTEGER

public static final ExpressionType RANDOM_INTEGER
Creates randomInteger expression.

See Also:
RandomInteger

RANDOM_INTEGER_EX

public static final ExpressionType RANDOM_INTEGER_EX
Creates randomIntegerEx expression.

See Also:
RandomIntegerEx

RECORD_EX

public static final ExpressionType RECORD_EX
Creates recordEx expression.

See Also:
RecordEx

ROUND

public static final ExpressionType ROUND
Creates round expression.

See Also:
Round

STRING_MATCH

public static final ExpressionType STRING_MATCH
Creates stringMatch expression.

See Also:
StringMatch

SUBSTRING

public static final ExpressionType SUBSTRING
Creates substring expression.

See Also:
Substring

SUBTRACT

public static final ExpressionType SUBTRACT
Creates subtract expression.

See Also:
Subtract

SUM

public static final ExpressionType SUM
Creates sum expression.

See Also:
Sum

TEST_VARIABLES

public static final ExpressionType TEST_VARIABLES
Creates testVariables expression.

See Also:
TestVariables

TRUNCATE

public static final ExpressionType TRUNCATE
Creates truncate expression.

See Also:
Truncate

VARIABLE

public static final ExpressionType VARIABLE
Creates variable expression.

See Also:
Variable
Method Detail

values

public static final ExpressionType[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ExpressionType c : ExpressionType.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static ExpressionType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getClassTag

public java.lang.String getClassTag()
Gets CLASS_TAG of this expression type.

Returns:
CLASS_TAG of this expression type

getMinimum

public java.lang.Integer getMinimum()
Gets minimum required children or null.

Returns:
minimum required children or null

getMaximum

public java.lang.Integer getMaximum()
Gets maximum allowed children or null.

Returns:
maximum allowed children or null

getRequiredCardinalities

public Cardinality[] getRequiredCardinalities(int index)
Gets list of all acceptable cardinalities for given position.

Parameters:
index - position
Returns:
list of all acceptable cardinalities for given position
See Also:
ExpressionParent.getRequiredCardinalities(int)

getRequiredBaseTypes

public BaseType[] getRequiredBaseTypes(int index)
Gets list of all acceptable baseTypes for given position.

Parameters:
index - position
Returns:
list of all acceptable baseTypes for given position
See Also:
ExpressionParent.getRequiredBaseTypes(int)

getProducedCardinalities

public Cardinality[] getProducedCardinalities()
Gets list of all produced cardinalities.

Returns:
list of all produced cardinalities
See Also:
Expression.getProducedCardinalities()

getProducedBaseTypes

public BaseType[] getProducedBaseTypes()
Gets list of all produced baseTypes.

Returns:
list of all produced baseTypes
See Also:
Expression.getProducedBaseTypes()

create

public abstract Expression create(ExpressionParent parent)
Creates expression.

Parameters:
parent - parent of created expression
Returns:
created expression

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Enum<ExpressionType>

getType

public static ExpressionType getType(java.lang.String classTag)
Gets expression type for given CLASS_TAG.

Parameters:
classTag - CLASS_TAG
Returns:
expression type for given CLASS_TAG

getSupportedTypes

public static ExpressionType[] getSupportedTypes(Cardinality[] requiredCardinalities,
                                                 BaseType[] requiredBaseTypes)
Gets all supported expression types for given requirements. Every returned expression type produces at least on required object.

Parameters:
requiredCardinalities - required cardinalities
requiredBaseTypes - required baseTypes
Returns:
all supported expression types for given requirements

getInstance

public static Expression getInstance(ExpressionParent parent,
                                     java.lang.String classTag)
Creates expression.

Parameters:
parent - parent of created expression
classTag - CLASS_TAG of created expression
Returns:
created expression


Copyright © 2009. All Rights Reserved.