Package org.openjdk.jmc.common.item
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 examplejava.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 Summary
Constructors Constructor Description AdvancedMinMaxConsumer(IMemberAccessor<? extends V,IItem> valueAccessor, IMemberAccessor<T,IItem> comparatorAccessor, boolean max)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consume(IItem newItem)
Consumes another item.V
getValue()
Aggregators.AdvancedMinMaxConsumer<V,T>
merge(Aggregators.AdvancedMinMaxConsumer<V,T> other)
Merges this object with the supplied object.
-
-
-
Constructor Detail
-
AdvancedMinMaxConsumer
public AdvancedMinMaxConsumer(IMemberAccessor<? extends V,IItem> valueAccessor, IMemberAccessor<T,IItem> comparatorAccessor, boolean max)
- Parameters:
valueAccessor
- the accessor for retrieving the valuecomparatorAccessor
- the accessor for retrieving the value to use for comparisonsmax
- whether to use the smallest value, or the greatest
-
-
Method Detail
-
consume
public void consume(IItem newItem)
Description copied from interface:IItemConsumer
Consumes another item.- Specified by:
consume
in interfaceIItemConsumer<V>
-
merge
public Aggregators.AdvancedMinMaxConsumer<V,T> merge(Aggregators.AdvancedMinMaxConsumer<V,T> other)
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 interfaceIItemConsumer<V>
- Parameters:
other
- another instance to merge with- Returns:
- the merged instance
-
getValue
public V getValue()
-
-