Interface IItemIterable

All Superinterfaces:
Iterable<IItem>, Supplier<Stream<IItem>>

public interface IItemIterable extends Iterable<IItem>, Supplier<Stream<IItem>>
A supplier of Iterator over IItem where all items are of the same type.
  • Method Details

    • getType

      IType<IItem> getType()
      Returns:
      The type for all items in the iterator
    • hasItems

      boolean hasItems()
      Returns:
      true if the iterable contains items, false otherwise
    • getItemCount

      long getItemCount()
      Returns:
      the number of items in the iterable
    • apply

      IItemIterable apply(Predicate<IItem> predicate)
      Creates a new item iterable with all items in this iterable that pass through the filter. The iterable may be eagerly or lazily evaluated.
      Parameters:
      predicate - the predicate to use when selecting items for the new collection
      Returns:
      A new collection of items
    • stream

      default Stream<IItem> stream()
      Creates a new sequential Stream of IItem from the IItemIterable.
      Returns:
      a new sequential Stream
    • parallelStream

      default Stream<IItem> parallelStream()
      Creates a new parallel Stream of IItem from the IItemIterable.
      Returns:
      a new parallel Stream
    • get

      default Stream<IItem> get()
      Specified by:
      get in interface Supplier<Stream<IItem>>