Enum Class Operation.ReturnTypeMode
java.lang.Object
java.lang.Enum<Operation.ReturnTypeMode>
net.ssehub.easy.varModel.model.datatypes.Operation.ReturnTypeMode
- All Implemented Interfaces:
Serializable,Comparable<Operation.ReturnTypeMode>,Constable
- Enclosing class:
Operation
Defines how to handle the return type of an operation.
We do not provide access to further generic parameters
as
- Author:
- Holger Eichelberger
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionChange it to the first generic parameter.Change it to the immediate type of the operand.Change it to a collection based on the original result type using the immediate type as type parameter.Change it to the deepest nested first generic operation parameter as generic type of the immediate operand in case that that is a collection.Change it to the first generic operation parameter as generic type of the immediate operand in case that that is a collection.Change it to the dereferenced immediate type of the operand.Use the return value of the first operation parameter.Use the return value of the first operation parameter.Change the return type to the value of the operand (first parameter), here required to be a constant type value.Change the return type to the operand with generic parameter.Change the return type to the type of the operand (first parameter).Do not change the return type. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether the operand (if a collection) shall fit the return type as parameter.private intStores the index of the source operation parameter.private booleanWhether searching for the result type shall be applied recursively / in a nested fashion if applicable.private intStores the index of the affected generic type. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateReturnTypeMode(int typeIndex, int paramIndex, boolean recurse, boolean checkOperand) Creates a new constant based on the affected generic type (index). -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the operand (if a collection) shall fit the return type as parameter.intReturns the index of the relevant generic type.intReturns the index of the relevant parameter.booleanrecurse()Returns whether searching for the result shall be applied in a recursive fashion if applicable.static Operation.ReturnTypeModeReturns the enum constant of this class with the specified name.static Operation.ReturnTypeMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNCHANGED
Do not change the return type. -
IMMEDIATE_OPERAND
Change it to the immediate type of the operand. Do not apply to basic/primitive types. -
IMMEDIATE_OPERAND_DEREF
Change it to the dereferenced immediate type of the operand. -
TYPED_OPERAND_1
Change the return type to the operand with generic parameter. If no generic parameter is available,IMMEDIATE_OPERANDis applied. -
TYPED_PARAM_1
Change the return type to the type of the operand (first parameter). If no parameter is available,IMMEDIATE_OPERANDis applied. -
TYPED_META_1
Change the return type to the value of the operand (first parameter), here required to be a constant type value. If no parameter is available,IMMEDIATE_OPERANDis applied. -
PARAM_1_CHECK
Use the return value of the first operation parameter. If not available,IMMEDIATE_OPERANDis applied. Signals that checking the operand is desired. -
PARAM_1
Use the return value of the first operation parameter. If not available,IMMEDIATE_OPERANDis applied. -
GENERIC_PARAM_1
Change it to the first generic parameter. If no generic parameter is available,IMMEDIATE_OPERANDis applied. -
IMMEDIATE_OPERAND_COLLECTION_PARAM_1
Change it to the first generic operation parameter as generic type of the immediate operand in case that that is a collection. If theIMMEDIATE_OPERANDis not a collection,PARAM_1will be applied. If no parameter parameter is available,IMMEDIATE_OPERANDis applied. -
IMMEDIATE_OPERAND_COLLECTION_NESTED_GENERIC_1
Change it to the deepest nested first generic operation parameter as generic type of the immediate operand in case that that is a collection. If theIMMEDIATE_OPERANDis not a collection,PARAM_1will be applied. If no parameter parameter is available,IMMEDIATE_OPERANDis applied. -
IMMEDIATE_OPERAND_COLLECTION
Change it to a collection based on the original result type using the immediate type as type parameter.
-
-
Field Details
-
typeIndex
private int typeIndexStores the index of the affected generic type. Negative if none is affected. -
paramIndex
private int paramIndexStores the index of the source operation parameter. Negative if none is considered. -
recurse
private boolean recurseWhether searching for the result type shall be applied recursively / in a nested fashion if applicable. -
checkOperand
private boolean checkOperandWhether the operand (if a collection) shall fit the return type as parameter.
-
-
Constructor Details
-
ReturnTypeMode
private ReturnTypeMode(int typeIndex, int paramIndex, boolean recurse, boolean checkOperand) Creates a new constant based on the affected generic type (index).- Parameters:
typeIndex- the affected generic type (negative if none is affected)paramIndex- the parameter type to be considered as return (none: relevant)recurse- searching for the result type shall be applied recursivelycheckOperand- whether the operand (if a collection) shall fit the return type as parameter
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
checkOperand
public boolean checkOperand()Whether the operand (if a collection) shall fit the return type as parameter.- Returns:
truefor check,falseelse
-
getGenericTypeIndex
public int getGenericTypeIndex()Returns the index of the relevant generic type.- Returns:
- a negative value if no generic type is affected, the affected index else
-
getParameterIndex
public int getParameterIndex()Returns the index of the relevant parameter.- Returns:
- a negative value if no parameter should be considered, the index else
-
recurse
public boolean recurse()Returns whether searching for the result shall be applied in a recursive fashion if applicable.- Returns:
truedo recursion,falseno recursion
-