org.eclipse.viatra.query.patternlanguage.util

## Class AggregatorUtil

- java.lang.Object
- - org.eclipse.viatra.query.patternlanguage.util.AggregatorUtil

-     public class AggregatorUtil
      extends java.lang.Object

  Since:
    1.4

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AggregatorUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `getAggregateVariableIndex(AggregatedValue value)`
    `static VariableValue` | `getAggregatorVariable(AggregatedValue value)` Returns the aggregate variable the aggregator should work with.
    `static java.util.List<VariableValue>` | `getAllAggregatorVariables(AggregatedValue value)` Returns all aggregate variables of the AggregatedValue.
    `static java.util.List<org.eclipse.xtext.common.types.JvmType>` | `getParameterTypes(org.eclipse.xtext.common.types.JvmDeclaredType aggregatorType)`
    `static java.util.List<org.eclipse.xtext.common.types.JvmType>` | `getReturnTypes(org.eclipse.xtext.common.types.JvmDeclaredType aggregatorType)`
    `static boolean` | `mustHaveAggregatorVariables(AggregatedValue value)` An aggregator expression may only have aggregated value as parameters if the corresponding `AggregatorType` annotation does not define a single Void parameter.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AggregatorUtil

          public AggregatorUtil()

  - ### Method Detail

    - #### getReturnTypes

          public static java.util.List<org.eclipse.xtext.common.types.JvmType> getReturnTypes(org.eclipse.xtext.common.types.JvmDeclaredType aggregatorType)

    - #### getParameterTypes

          public static java.util.List<org.eclipse.xtext.common.types.JvmType> getParameterTypes(org.eclipse.xtext.common.types.JvmDeclaredType aggregatorType)

    - #### mustHaveAggregatorVariables

          public static boolean mustHaveAggregatorVariables(AggregatedValue value)

      An aggregator expression may only have aggregated value as parameters if the corresponding `AggregatorType` annotation does not define a single Void parameter. However, in that case, it _must_ have an aggregate parameter.

    - #### getAggregateVariableIndex

          public static int getAggregateVariableIndex(AggregatedValue value)

    - #### getAggregatorVariable

          public static VariableValue getAggregatorVariable(AggregatedValue value)

      Returns the aggregate variable the aggregator should work with. Given in a well-formed AggregatedValue only a single aggregate variable should be present, this should be unique.

    - #### getAllAggregatorVariables

          public static java.util.List<VariableValue> getAllAggregatorVariables(AggregatedValue value)

      Returns all aggregate variables of the AggregatedValue. If the AggregatedValue has more aggregate variables, it represents an error in the specification.