Class SingleEntryItemCollection.SingleEntryIItemIterable
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.rules.jdk.util.SingleEntryItemCollection.SingleEntryIItemIterable
-
- All Implemented Interfaces:
java.lang.Iterable<IItem>
,IItemIterable
- Enclosing class:
- SingleEntryItemCollection
private static class SingleEntryItemCollection.SingleEntryIItemIterable extends java.lang.Object implements IItemIterable
-
-
Constructor Summary
Constructors Constructor Description SingleEntryIItemIterable(IItem item)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IItemIterable
apply(IPredicate<IItem> predicate)
Creates a new item iterable with all items in this iterable that pass through the filter.long
getItemCount()
IType<IItem>
getType()
boolean
hasItems()
java.util.Iterator<IItem>
iterator()
-
-
-
Field Detail
-
itemList
private final java.util.List<IItem> itemList
-
-
Constructor Detail
-
SingleEntryIItemIterable
public SingleEntryIItemIterable(IItem item)
-
-
Method Detail
-
iterator
public java.util.Iterator<IItem> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<IItem>
-
getType
public IType<IItem> getType()
- Specified by:
getType
in interfaceIItemIterable
- Returns:
- The type for all items in the iterator
-
hasItems
public boolean hasItems()
- Specified by:
hasItems
in interfaceIItemIterable
- Returns:
- true if the iterable contains items, false otherwise
-
getItemCount
public long getItemCount()
- Specified by:
getItemCount
in interfaceIItemIterable
- Returns:
- the number of items in the iterable
-
apply
public IItemIterable apply(IPredicate<IItem> predicate)
Description copied from interface:IItemIterable
Creates a new item iterable with all items in this iterable that pass through the filter. The iterable may be eagerly or lazily evaluated.- Specified by:
apply
in interfaceIItemIterable
- Parameters:
predicate
- the predicate to use when selecting items for the new collection- Returns:
- A new collection of items
-
-