Package org.openjdk.jmc.common.item
Interface IItemCollection
-
- All Superinterfaces:
Iterable<IItemIterable>
public interface IItemCollection extends Iterable<IItemIterable>
An immutable collection of items.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated 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.Set<IRange<IQuantity>>
getUnfilteredTimeRanges()
Deprecated.see https://bugs.openjdk.java.net/browse/JMC-7103.boolean
hasItems()
default Stream<IItemIterable>
parallelStream()
default Stream<IItemIterable>
stream()
default <T> Supplier<Stream<T>>
values(IAttribute<T> attribute)
Returns the values for the supplied attribute from this IItemCollection.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
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
-
getUnfilteredTimeRanges
@Deprecated Set<IRange<IQuantity>> getUnfilteredTimeRanges()
Deprecated.see https://bugs.openjdk.java.net/browse/JMC-7103.Returns a set of IRange representations of the time ranges represented by this item collection. This set is not affected by any filtering operations on the item collection since its use is to show the time ranges in which events could possibly have been occurred.- Returns:
- a set of IRange objects representing the time ranges available in this IItemCollection
-
stream
default Stream<IItemIterable> stream()
- Returns:
- a new sequential
Stream
-
parallelStream
default Stream<IItemIterable> parallelStream()
- Returns:
- a new parallel
Stream
-
values
default <T> Supplier<Stream<T>> values(IAttribute<T> attribute)
Returns the values for the supplied attribute from this IItemCollection.- Type Parameters:
T
- the type of the attribute, e.g. IQuantity.- Parameters:
attribute
- the attribute to retrieve values for.- Returns:
- a stream of values.
-
-