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

public static enum Operation.ReturnTypeMode extends 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
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Change 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

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Whether the operand (if a collection) shall fit the return type as parameter.
    private int
    Stores the index of the source operation parameter.
    private boolean
    Whether searching for the result type shall be applied recursively / in a nested fashion if applicable.
    private int
    Stores the index of the affected generic type.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    ReturnTypeMode(int typeIndex, int paramIndex, boolean recurse, boolean checkOperand)
    Creates a new constant based on the affected generic type (index).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether the operand (if a collection) shall fit the return type as parameter.
    int
    Returns the index of the relevant generic type.
    int
    Returns the index of the relevant parameter.
    boolean
    Returns whether searching for the result shall be applied in a recursive fashion if applicable.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • 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_OPERAND is 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_OPERAND is 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_OPERAND is 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_OPERAND is 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_OPERAND is 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_OPERAND is 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 the IMMEDIATE_OPERAND is not a collection, PARAM_1 will be applied. If no parameter parameter is available, IMMEDIATE_OPERAND is 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 the IMMEDIATE_OPERAND is not a collection, PARAM_1 will be applied. If no parameter parameter is available, IMMEDIATE_OPERAND is 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 Details

    • 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 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 recursively
      checkOperand - whether the operand (if a collection) shall fit the return type as parameter
  • Method Details

    • values

      public static Operation.ReturnTypeMode[] 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

      public static Operation.ReturnTypeMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • checkOperand

      public boolean checkOperand()
      Whether the operand (if a collection) shall fit the return type as parameter.
      Returns:
      true for check, false else
    • 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:
      true do recursion, false no recursion