Package org.openjdk.jmc.common.item
Interface IItemCollection
-
- All Superinterfaces:
java.lang.Iterable<IItemIterable>
- All Known Implementing Classes:
EventCollection
,SingleEntryItemCollection
public interface IItemCollection extends java.lang.Iterable<IItemIterable>
An immutable collection of items.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IItemCollection
apply(IItemFilter filter)
Creates a new item collection with all items in this collection that pass through the filter.<V,C extends IItemConsumer<C>>
VgetAggregate(IAggregator<V,C> aggregator)
Calculates an aggregated value for the items in this collection.boolean
hasItems()
-
-
-
Method Detail
-
apply
IItemCollection apply(IItemFilter filter)
Creates a new item collection with all items in this collection that pass through the filter. The collection may be eagerly or lazily evaluated.- Parameters:
filter
- the filter to use when selecting items for the new collection- Returns:
- a new collection of items
-
getAggregate
<V,C extends IItemConsumer<C>> V getAggregate(IAggregator<V,C> aggregator)
Calculates an aggregated value for the items in this collection.- Type Parameters:
V
- aggregate result value typeC
- Item consumer type. SeeIAggregator
.- Returns:
- the aggregated value
-
hasItems
boolean hasItems()
- Returns:
true
if the collections contains items,false
otherwise
-
-