com.github.basking2.sdsai.itrex.functions.FlattenFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdsai-itrex Show documentation
Show all versions of sdsai-itrex Show documentation
An S-Expression inspiried library focused on iterators.
package com.github.basking2.sdsai.itrex.functions;
import com.github.basking2.sdsai.itrex.EvaluationContext;
import com.github.basking2.sdsai.itrex.iterators.IteratorIterator;
import java.util.Arrays;
import java.util.Iterator;
import static com.github.basking2.sdsai.itrex.iterators.Iterators.mapIterator;
/**
* Flatten an iterator of iterators a single layer.
*
* That is, if you have an iterator-of-iterator-of-iterators, you will get back an iterator-of-iterators.
* If you have an iterator-of-iterator-of-ints, you will get back an iterator of ints.
*
* Another way to view this is that it takes away the top-level iterator.
*/
public class FlattenFunction implements FunctionInterface> {
@SuppressWarnings("unchecked")
@Override
public Iterator
© 2015 - 2025 Weber Informatics LLC | Privacy Policy