Class IvmlOrderedEnumMinMaxOperationDescriptor
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlOperationDescriptor
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlOrderedEnumMinMaxOperationDescriptor
-
- All Implemented Interfaces:
IMetaOperation
public class IvmlOrderedEnumMinMaxOperationDescriptor extends IvmlOperationDescriptor
Represents the minimum or maximum operation for ordered IVML enums.- Author:
- Holger Eichelberger
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIvmlOrderedEnumMinMaxOperationDescriptor.OperationKindThe operation kinds.-
Nested classes/interfaces inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
OperationDescriptor.AliasType
-
Nested classes/interfaces inherited from interface net.ssehub.easy.instantiation.core.model.vilTypes.IMetaOperation
IMetaOperation.CompatibilityResult
-
-
Field Summary
Fields Modifier and Type Field Description private IvmlOrderedEnumMinMaxOperationDescriptor.OperationKindoperation-
Fields inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
CONSTRUCTOR_NAME, EMPTY_PARAMETER
-
-
Constructor Summary
Constructors Constructor Description IvmlOrderedEnumMinMaxOperationDescriptor()For serialization.IvmlOrderedEnumMinMaxOperationDescriptor(TypeDescriptor<?> declaringType, IvmlOrderedEnumMinMaxOperationDescriptor.OperationKind operation)Creates a new min/max operation descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectinvoke(java.lang.Object... args)Invokes the specified operation.IMetaOperation.CompatibilityResultisCompatible(java.lang.Class<?> retType, java.lang.Object... params)Returns whether the operation represented by this instance is compatible to the given return type and parameters.private EnumValuemax(EnumValue v1, EnumValue v2)Returns the maximum enumeration value.private EnumValuemin(EnumValue v1, EnumValue v2)Returns the minimum enumeration value.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.configuration.IvmlOperationDescriptor
convertArgument, createParameterList, getDeclaringTypeNameFallback, getJavaSignature, initializeParameters, initializeReturnType, isFirstParameterOperand, isPlaceholder, isStatic, storeArtifactsBeforeExecution, useGenericParameterAsReturn, useParameterAsReturn
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.vilTypes.OperationDescriptor
acceptsImplicitParameters, acceptsNamedParameters, allowsAggregation, composeExceptionMessage, convertVariables, flatten, getAliasType, getDeclaringType, getDeclaringTypeName, getName, getOperationType, getParameter, getParameter, getParameterCount, getParameterType, getRequiredParameterCount, getReturnType, getSignature, getStoredName, isAlias, isConstructor, isConstructor, isConversion, isGenericCollectionOperation, isIteratingCollectionOperation, isOclCompliant, isOperation, isSameSignature, isTypeSelect, requiresDynamicExpressionProcessing, setCharacteristics, setParameters, setReturnType, specializeFor, throwIncompatibleParameter, toString, trace, useAny, useOperandTypeAsParameter
-
-
-
-
Field Detail
-
operation
private IvmlOrderedEnumMinMaxOperationDescriptor.OperationKind operation
-
-
Constructor Detail
-
IvmlOrderedEnumMinMaxOperationDescriptor
IvmlOrderedEnumMinMaxOperationDescriptor()
For serialization.
-
IvmlOrderedEnumMinMaxOperationDescriptor
IvmlOrderedEnumMinMaxOperationDescriptor(TypeDescriptor<?> declaringType, IvmlOrderedEnumMinMaxOperationDescriptor.OperationKind operation)
Creates a new min/max operation descriptor.- Parameters:
declaringType- the declaring typeoperation- the kind of operation to execute
-
-
Method Detail
-
isCompatible
public IMetaOperation.CompatibilityResult isCompatible(java.lang.Class<?> retType, java.lang.Object... params)
Description copied from interface:IMetaOperationReturns whether the operation represented by this instance is compatible to the given return type and parameters. This method does not consider possible unnamed parameter rather than the underlying Java parameter.- Parameters:
retType- the return type (may be null in order to ignore this parameter)params- the parameters (may be null if there are none, may be classes)- Returns:
- an instance of
IMetaOperation.CompatibilityResultdenoting the actual compatibility level
-
invoke
public java.lang.Object invoke(java.lang.Object... args) throws VilExceptionDescription copied from interface:IMetaOperationInvokes the specified operation. This method does not consider possible unnamed parameter rather than the underlying Java parameter. In case ofIMetaOperation.acceptsNamedParameters()the caller must ensure that the last parameter is amap<String, Object>containing the named parameters.- Parameters:
args- the arguments, in case of non-static operations the first argument must be the object to execute on- Returns:
- the result of the execution
- Throws:
VilException- if the invocation fails- See Also:
IMetaOperation.isCompatible(java.lang.Class<?>, java.lang.Object...)
-
min
private EnumValue min(EnumValue v1, EnumValue v2)
Returns the minimum enumeration value.- Parameters:
v1- the first value to comparev2- the second value to compare- Returns:
- the minimum of both values
-
-