Package org.openjdk.jmc.common.item
Class GroupingAggregator.GroupingConsumer<K,G extends IItemConsumer<G>>
- java.lang.Object
-
- org.openjdk.jmc.common.item.GroupingAggregator.GroupingConsumer<K,G>
-
- All Implemented Interfaces:
IItemConsumer<GroupingAggregator.GroupingConsumer<K,G>>
- Enclosing class:
- GroupingAggregator
private static class GroupingAggregator.GroupingConsumer<K,G extends IItemConsumer<G>> extends java.lang.Object implements IItemConsumer<GroupingAggregator.GroupingConsumer<K,G>>
-
-
Field Summary
Fields Modifier and Type Field Description private IItemConsumerFactory<G>
groupAggregator
private IMemberAccessor<? extends K,IItem>
keyAccessor
private EntryHashMap<K,GroupingAggregator.ObjectEntry<K,G>>
map
-
Constructor Summary
Constructors Modifier Constructor Description private
GroupingConsumer(IMemberAccessor<? extends K,IItem> keyAccessor, IItemConsumerFactory<G> groupAggregator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
consume(IItem item)
Consumes another item.(package private) java.util.Iterator<GroupingAggregator.ObjectEntry<K,G>>
getGroups()
private void
initialize(IType<IItem> type)
GroupingAggregator.GroupingConsumer<K,G>
merge(GroupingAggregator.GroupingConsumer<K,G> other)
Merges this object with the supplied object.
-
-
-
Field Detail
-
map
private EntryHashMap<K,GroupingAggregator.ObjectEntry<K,G extends IItemConsumer<G>>> map
-
keyAccessor
private final IMemberAccessor<? extends K,IItem> keyAccessor
-
groupAggregator
private final IItemConsumerFactory<G extends IItemConsumer<G>> groupAggregator
-
-
Constructor Detail
-
GroupingConsumer
private GroupingConsumer(IMemberAccessor<? extends K,IItem> keyAccessor, IItemConsumerFactory<G> groupAggregator)
-
-
Method Detail
-
consume
public void consume(IItem item)
Description copied from interface:IItemConsumer
Consumes another item.- Specified by:
consume
in interfaceIItemConsumer<K>
-
merge
public GroupingAggregator.GroupingConsumer<K,G> merge(GroupingAggregator.GroupingConsumer<K,G> 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<K>
- Parameters:
other
- another instance to merge with- Returns:
- the merged instance
-
getGroups
java.util.Iterator<GroupingAggregator.ObjectEntry<K,G>> getGroups()
-
-