Package org.openjdk.jmc.common.item
Class Aggregators.SumConsumer
- java.lang.Object
-
- org.openjdk.jmc.common.item.Aggregators.QuantityConsumer<Aggregators.SumConsumer>
-
- org.openjdk.jmc.common.item.Aggregators.SumConsumer
-
- All Implemented Interfaces:
IItemConsumer<Aggregators.SumConsumer>
- Enclosing class:
- Aggregators
private static class Aggregators.SumConsumer extends Aggregators.QuantityConsumer<Aggregators.SumConsumer>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) double
sum
(package private) IUnit
unit
-
Fields inherited from class org.openjdk.jmc.common.item.Aggregators.QuantityConsumer
accessor
-
-
Constructor Summary
Constructors Constructor Description SumConsumer(IMemberAccessor<? extends IQuantity,IItem> accessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consume(IItem item)
Consumes another item.Aggregators.SumConsumer
merge(Aggregators.SumConsumer other)
Merges this object with the supplied object.
-
-
-
Field Detail
-
sum
double sum
-
unit
IUnit unit
-
-
Constructor Detail
-
SumConsumer
SumConsumer(IMemberAccessor<? extends IQuantity,IItem> accessor)
-
-
Method Detail
-
consume
public void consume(IItem item)
Description copied from interface:IItemConsumer
Consumes another item.
-
merge
public Aggregators.SumConsumer merge(Aggregators.SumConsumer 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.- Parameters:
other
- another instance to merge with- Returns:
- the merged instance
-
-