Enum Operation.ReturnTypeMode
- java.lang.Object
-
- java.lang.Enum<Operation.ReturnTypeMode>
-
- net.ssehub.easy.varModel.model.datatypes.Operation.ReturnTypeMode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Operation.ReturnTypeMode>
- Enclosing class:
- Operation
public static enum Operation.ReturnTypeMode extends java.lang.Enum<Operation.ReturnTypeMode>
Defines how to handle the return type of an operation. We do not provide access to further generic parameters as- Author:
- Holger Eichelberger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description GENERIC_PARAM_1Change it to the first generic parameter.IMMEDIATE_OPERANDChange it to the immediate type of the operand.IMMEDIATE_OPERAND_COLLECTIONChange it to a collection based on the original result type using the immediate type as type parameter.IMMEDIATE_OPERAND_COLLECTION_NESTED_GENERIC_1Change it to the deepest nested first generic operation parameter as generic type of the immediate operand in case that that is a collection.IMMEDIATE_OPERAND_COLLECTION_PARAM_1Change it to the first generic operation parameter as generic type of the immediate operand in case that that is a collection.IMMEDIATE_OPERAND_DEREFChange it to the dereferenced immediate type of the operand.PARAM_1Use the return value of the first operation parameter.PARAM_1_CHECKUse the return value of the first operation parameter.TYPED_META_1Change the return type to the value of the operand (first parameter), here required to be a constant type value.TYPED_OPERAND_1Change the return type to the operand with generic parameter.TYPED_PARAM_1Change the return type to the type of the operand (first parameter).UNCHANGEDDo not change the return type.
-
Field Summary
Fields Modifier and Type Field Description private booleancheckOperandWhether the operand (if a collection) shall fit the return type as parameter.private intparamIndexStores the index of the source operation parameter.private booleanrecurseWhether searching for the result type shall be applied recursively / in a nested fashion if applicable.private inttypeIndexStores the index of the affected generic type.
-
Constructor Summary
Constructors Modifier Constructor Description privateReturnTypeMode(int typeIndex, int paramIndex, boolean recurse, boolean checkOperand)Creates a new constant based on the affected generic type (index).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckOperand()Whether the operand (if a collection) shall fit the return type as parameter.intgetGenericTypeIndex()Returns the index of the relevant generic type.intgetParameterIndex()Returns the index of the relevant parameter.booleanrecurse()Returns whether searching for the result shall be applied in a recursive fashion if applicable.static Operation.ReturnTypeModevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Operation.ReturnTypeMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNCHANGED
public static final Operation.ReturnTypeMode UNCHANGED
Do not change the return type.
-
IMMEDIATE_OPERAND
public static final Operation.ReturnTypeMode IMMEDIATE_OPERAND
Change it to the immediate type of the operand. Do not apply to basic/primitive types.
-
IMMEDIATE_OPERAND_DEREF
public static final Operation.ReturnTypeMode IMMEDIATE_OPERAND_DEREF
Change it to the dereferenced immediate type of the operand.
-
TYPED_OPERAND_1
public static final Operation.ReturnTypeMode 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
public static final Operation.ReturnTypeMode 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
public static final Operation.ReturnTypeMode 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
public static final Operation.ReturnTypeMode 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
public static final Operation.ReturnTypeMode PARAM_1
Use the return value of the first operation parameter. If not available,IMMEDIATE_OPERANDis applied.
-
GENERIC_PARAM_1
public static final Operation.ReturnTypeMode GENERIC_PARAM_1
Change it to the first generic parameter. If no generic parameter is available,IMMEDIATE_OPERANDis applied.
-
IMMEDIATE_OPERAND_COLLECTION_PARAM_1
public static final Operation.ReturnTypeMode 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
public static final Operation.ReturnTypeMode 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
public static final Operation.ReturnTypeMode IMMEDIATE_OPERAND_COLLECTION
Change it to a collection based on the original result type using the immediate type as type parameter.
-
-
Field Detail
-
typeIndex
private int typeIndex
Stores the index of the affected generic type. Negative if none is affected.
-
paramIndex
private int paramIndex
Stores the index of the source operation parameter. Negative if none is considered.
-
recurse
private boolean recurse
Whether searching for the result type shall be applied recursively / in a nested fashion if applicable.
-
checkOperand
private boolean checkOperand
Whether the operand (if a collection) shall fit the return type as parameter.
-
-
Constructor Detail
-
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 Detail
-
values
public static Operation.ReturnTypeMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Operation.ReturnTypeMode c : Operation.ReturnTypeMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Operation.ReturnTypeMode 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 namejava.lang.NullPointerException- 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
-
-