org.eclipse.viatra.query.runtime.matchers.aggregators

## Class ExtremumOperator<T extends java.lang.Comparable<T>>

- java.lang.Object
- - org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.AbstractMultisetAggregationOperator<T,com.google.common.collect.SortedMultiset<T>,T>
  - - org.eclipse.viatra.query.runtime.matchers.aggregators.ExtremumOperator<T>

- All Implemented Interfaces:
    IMultisetAggregationOperator<T,com.google.common.collect.SortedMultiset<T>,T>

      public class ExtremumOperator<T extends java.lang.Comparable<T>>
      extends AbstractMultisetAggregationOperator<T,com.google.common.collect.SortedMultiset<T>,T>

  Incrementally computes the minimum or maximum of java.lang.Comparable values, using the default comparison
  Since:
    1.4

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ExtremumOperator.Extreme`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.google.common.collect.SortedMultiset<T>` | `createNeutral()`
    `T` | `getAggregate(com.google.common.collect.SortedMultiset<T> result)`
    `static <T extends java.lang.Comparable<T>> ExtremumOperator<T>` | `getMax()`
    `static <T extends java.lang.Comparable<T>> ExtremumOperator<T>` | `getMin()`
    `java.lang.String` | `getName()` A name or identifier of the operator.
    `java.lang.String` | `getShortDescription()` A textual description of the operator.
    `boolean` | `isNeutral(com.google.common.collect.SortedMultiset<T> result)`
    `com.google.common.collect.SortedMultiset<T>` | `update(com.google.common.collect.SortedMultiset<T> oldResult, T updateValue, boolean isInsertion)`

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

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

- - ### Method Detail

    - #### getMin

          public static <T extends java.lang.Comparable<T>> ExtremumOperator<T> getMin()

    - #### getMax

          public static <T extends java.lang.Comparable<T>> ExtremumOperator<T> getMax()

    - #### getShortDescription

          public java.lang.String getShortDescription()

      Description copied from interface: `IMultisetAggregationOperator`
      A textual description of the operator.

    - #### getName

          public java.lang.String getName()

      Description copied from interface: `IMultisetAggregationOperator`
      A name or identifier of the operator.

    - #### createNeutral

          public com.google.common.collect.SortedMultiset<T> createNeutral()

      Returns:
        the neutral element, i.e. the interim result of aggregating an empty multiset.

    - #### isNeutral

          public boolean isNeutral(com.google.common.collect.SortedMultiset<T> result)

      Returns:
        true if the interim result is equivalent to the neutral element, as if there are no values in the multiset. Must return true if the multiset is empty.

    - #### update

          public com.google.common.collect.SortedMultiset<T> update(com.google.common.collect.SortedMultiset<T> oldResult,
                                                                    T updateValue,
                                                                    boolean isInsertion)

      Returns:
        an updated intermediate result, changed to reflect that a given object was added to / removed from the multiset (as indicated by the parameter isInsertion)

    - #### getAggregate

          public T getAggregate(com.google.common.collect.SortedMultiset<T> result)

      Returns:
        the aggregate result obtained from the given intermediate result. May be null to indicate that the current multiset cannot be aggregated (e.g. 0 elements have no minimum).