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
ConstructorsConstructorDescriptionAdvancedMinMaxConsumer
(IMemberAccessor<? extends V, IItem> valueAccessor, IMemberAccessor<T, IItem> comparatorAccessor, boolean max) -
Method Summary
-
Constructor Details
-
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 Details
-
consume
Description copied from interface:IItemConsumer
Consumes another item.- Specified by:
consume
in interfaceIItemConsumer<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 interfaceIItemConsumer<V>
- Parameters:
other
- another instance to merge with- Returns:
- the merged instance
-
getValue
-