class EventCollection extends java.lang.Object implements IItemCollection
IItemCollection
using IItemIterable
iterators.Modifier and Type | Class and Description |
---|---|
private static class |
EventCollection.EventTypeEntry |
Modifier and Type | Field and Description |
---|---|
private java.util.Set<IRange<IQuantity>> |
chunkRanges |
private java.util.ArrayList<EventCollection.EventTypeEntry> |
items |
private java.util.Set<IType<IItem>> |
types |
Modifier | Constructor and Description |
---|---|
private |
EventCollection(java.util.ArrayList<EventCollection.EventTypeEntry> items,
java.util.Set<IRange<IQuantity>> chunkRanges) |
Modifier and Type | Method and Description |
---|---|
private static <V,C extends IItemConsumer<C>> |
aggregate(IAggregator<V,C> aggregator,
java.util.Iterator<? extends IItemIterable> items) |
EventCollection |
apply(IItemFilter filter)
Creates a new item collection with all items in this collection that pass through the filter.
|
(package private) static IItemCollection |
build(EventArrays events) |
private static java.util.Iterator<IItem> |
buildIterator(IItem[] array,
java.util.function.Predicate<? super IItem> filter) |
<V,C extends IItemConsumer<C>> |
getAggregate(IAggregator<V,C> aggregator)
Calculates an aggregated value for the items in this collection.
|
java.util.Set<IRange<IQuantity>> |
getUnfilteredTimeRanges()
Returns a set of IRange representations of the time ranges represented by this item
collection.
|
boolean |
hasItems() |
private static boolean |
isFiltered(java.util.function.Predicate<?> filter) |
java.util.Iterator<IItemIterable> |
iterator() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parallelStream, stream, values
private final java.util.ArrayList<EventCollection.EventTypeEntry> items
private EventCollection(java.util.ArrayList<EventCollection.EventTypeEntry> items, java.util.Set<IRange<IQuantity>> chunkRanges)
static IItemCollection build(EventArrays events)
public EventCollection apply(IItemFilter filter)
IItemCollection
apply
in interface IItemCollection
filter
- the filter to use when selecting items for the new collectionprivate static java.util.Iterator<IItem> buildIterator(IItem[] array, java.util.function.Predicate<? super IItem> filter)
private static boolean isFiltered(java.util.function.Predicate<?> filter)
public java.util.Iterator<IItemIterable> iterator()
iterator
in interface java.lang.Iterable<IItemIterable>
public boolean hasItems()
hasItems
in interface IItemCollection
true
if the collections contains items, false
otherwisepublic <V,C extends IItemConsumer<C>> V getAggregate(IAggregator<V,C> aggregator)
IItemCollection
getAggregate
in interface IItemCollection
V
- aggregate result value typeC
- Item consumer type. See IAggregator
.private static <V,C extends IItemConsumer<C>> V aggregate(IAggregator<V,C> aggregator, java.util.Iterator<? extends IItemIterable> items)
public java.util.Set<IRange<IQuantity>> getUnfilteredTimeRanges()
IItemCollection
getUnfilteredTimeRanges
in interface IItemCollection