Class Aggregators.AdvancedMinMaxConsumer<V,T extends Comparable<T>>

java.lang.Object
org.openjdk.jmc.common.item.Aggregators.AdvancedMinMaxConsumer<V,T>
Type Parameters:
V - the return value type, for example java.lang.String
T - the value type for the ordering
All Implemented Interfaces:
IItemConsumer<Aggregators.AdvancedMinMaxConsumer<V,T>>
Enclosing class:
Aggregators

public static class Aggregators.AdvancedMinMaxConsumer<V,T extends Comparable<T>> extends Object implements IItemConsumer<Aggregators.AdvancedMinMaxConsumer<V,T>>
This consumer separates the attribute for which to do the ordering from the attribute to use for accessing the value. It is typically used within the AdvancedMinMaxAggregator for getting a specific value from the first or last event from a collection of events.
  • Constructor Details

    • AdvancedMinMaxConsumer

      public AdvancedMinMaxConsumer(IMemberAccessor<? extends V,IItem> valueAccessor, IMemberAccessor<T,IItem> comparatorAccessor, boolean max)
      Parameters:
      valueAccessor - the accessor for retrieving the value
      comparatorAccessor - the accessor for retrieving the value to use for comparisons
      max - whether to use the smallest value, or the greatest
  • Method Details

    • consume

      public void consume(IItem newItem)
      Description copied from interface: IItemConsumer
      Consumes another item.
      Specified by:
      consume in interface IItemConsumer<V>
    • merge

      Description copied from interface: IItemConsumer
      Merges this object with the supplied object. Normally this is another item consumer of the same type and the output result is a consumer with an internal state that reflects the state of both the current consumer and the input value.
      Specified by:
      merge in interface IItemConsumer<V>
      Parameters:
      other - another instance to merge with
      Returns:
      the merged instance
    • getValue

      public V getValue()