# AggregateFunction (ARX Developer Documentation)

org.deidentifier.arx.aggregates

## Class AggregateFunction<T>

- java.lang.Object
- - org.deidentifier.arx.aggregates.AggregateFunction<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    AggregateFunction.AggregateFunctionWithParameter, AggregateFunction.GenericArithmeticMean, AggregateFunction.GenericArithmeticMeanOfBounds, AggregateFunction.GenericBounds, AggregateFunction.GenericGeometricMean, AggregateFunction.GenericGeometricMeanOfBounds, AggregateFunction.GenericInterval, AggregateFunction.GenericSet

      public abstract class AggregateFunction<T>
      extends java.lang.Object
      implements java.io.Serializable

  This abstract class represents an aggregate function.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AggregateFunction.AggregateFunctionBuilder<T>` A builder for aggregate functions.
    `static class` | `AggregateFunction.AggregateFunctionWithParameter<T>` An aggregate function that has a parameter.
    `static class` | `AggregateFunction.GenericArithmeticMean<T>` An aggregate function that returns the arithmetic mean, if it may be computed, "NULL" otherwise.
    `static class` | `AggregateFunction.GenericArithmeticMeanOfBounds<T>` An aggregate function that returns the arithmetic mean of min & max, if it may be computed, "NULL" otherwise.
    `static class` | `AggregateFunction.GenericBounds<T>` An aggregate function that returns an interval consisting of the first and the last element following the predefined order .
    `static class` | `AggregateFunction.GenericCommonPrefix<T>` An aggregate function that returns a common prefix.
    `static class` | `AggregateFunction.GenericConstant<T>` An aggregate function that returns a constant value.
    `static class` | `AggregateFunction.GenericGeometricMean<T>` An aggregate function that returns the geometric mean, if it may be computed, "NULL" otherwise.
    `static class` | `AggregateFunction.GenericGeometricMeanOfBounds<T>` An aggregate function that returns the geometric mean of min & max, if it may be computed, "NULL" otherwise.
    `static class` | `AggregateFunction.GenericInterval<T>` An aggregate function that returns an interval [min, max] .
    `static class` | `AggregateFunction.GenericSet<T>` An aggregate function that returns a set of all data values.
    `static class` | `AggregateFunction.GenericSetOfPrefixes<T>` An aggregate function that returns a set of the prefixes of the data values.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DataType<T>` | `type` The data type.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AggregateFunction(DataType<T> type)` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract java.lang.String` | `aggregate(java.lang.String[] values)` This function returns an aggregate value.
    `static <T> AggregateFunction.AggregateFunctionBuilder<T>` | `forType(DataType<T> type)` Returns a builder for the given data type.
    `boolean` | `hasParameter()` Returns whether the function accepts a parameter.
    `abstract java.lang.String` | `toLabel()` Returns a label.
    `abstract java.lang.String` | `toString()`

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

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

- - ### Field Detail

    - #### type

          protected DataType<T> type

      The data type.

  - ### Constructor Detail

    - #### AggregateFunction

          protected AggregateFunction(DataType<T> type)

      Constructor.
      Parameters:
        `type` -

  - ### Method Detail

    - #### forType

          public static <T> AggregateFunction.AggregateFunctionBuilder<T> forType(DataType<T> type)

      Returns a builder for the given data type.
      Type Parameters:
        `T` -
      Parameters:
        `type` -
      Returns:

    - #### aggregate

          public abstract java.lang.String aggregate(java.lang.String[] values)

      This function returns an aggregate value.
      Parameters:
        `values` -
      Returns:

    - #### hasParameter

          public boolean hasParameter()

      Returns whether the function accepts a parameter.
      Returns:

    - #### toLabel

          public abstract java.lang.String toLabel()

      Returns a label.
      Returns:

    - #### toString

          public abstract java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`