Class LazyTakeIterable<T>

java.lang.Object
de.renebergelt.quiterables.iterators.LazyTakeIterable<T>
Type Parameters:
T - Type of the elements in this Iterable
All Implemented Interfaces:
Iterable<T>

public class LazyTakeIterable<T> extends Object implements Iterable<T>
Iterable which takes a certain amount of elements or takes as long as all elements match a predicate
Author:
René Bergelt
  • Constructor Details

    • LazyTakeIterable

      public LazyTakeIterable(Iterable<T> _wrapped, int _amount)
      Create a new lazy take iterable which wraps the given iterable
      Parameters:
      _wrapped - The wrapped iterable
      _amount - Number of elements to take
    • LazyTakeIterable

      public LazyTakeIterable(Iterable<T> _wrapped, Predicate<T> _takeWhileCondition)
      Create a new lazy take iterable which wraps the given iterable
      Parameters:
      _wrapped - The wrapped iterable
      _takeWhileCondition - Condition to take an element from the beginning
  • Method Details