Class LazyIterator<InputType, ReturnType>
java.lang.Object
fr.inria.rules.integraal.component_builder.evaluators.generic.processors.LazyIterator<InputType, ReturnType>
- Type Parameters:
InputType- the type of elements in the source collectionReturnType- the type of elements to be returned after transformation
- All Implemented Interfaces:
Iterable<ReturnType>
The LazyIterator is a generic iterable that provides a way to lazily process
elements of a collection using a specified transformation function.
This allows for deferred execution of the transformation logic, which can be
beneficial for performance in certain scenarios.
-
Constructor Summary
ConstructorsConstructorDescriptionLazyIterator(Collection<InputType> source, Function<InputType, ReturnType> lazyTransformationFunction) Constructs a LazyIterator with the given source collection and transformation function. -
Method Summary
Modifier and TypeMethodDescriptioniterator()Returns an iterator over elements of type ReturnType, each transformed from elements of type InputType using the provided transformation function.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
LazyIterator
public LazyIterator(Collection<InputType> source, Function<InputType, ReturnType> lazyTransformationFunction) Constructs a LazyIterator with the given source collection and transformation function.- Parameters:
source- the source collection containing elements of type InputTypelazyTransformationFunction- the function to apply to each element of the source, which transforms an element of type InputType into type ReturnType
-
-
Method Details