All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kiwiproject.stream.IntStreams Maven / Gradle / Ivy

Go to download

Kiwi is a utility library. We really like Google's Guava, and also use Apache Commons. But if they don't have something we need, and we think it is useful, this is where we put it.

There is a newer version: 4.5.2
Show newest version
package org.kiwiproject.stream;

import lombok.experimental.UtilityClass;

import java.util.List;
import java.util.stream.IntStream;

/**
 * Static utilities related to {@link IntStream}.
 */
@UtilityClass
public class IntStreams {

    /**
     * Return an {@link IntStream} whose values are the indices ranging from {@code 0} to {@code values.size() - 1}.
     *
     * @param values the list
     * @param     the list element type
     * @return IntStream of the list indices
     */
    public static  IntStream indicesOf(List values) {
        return IntStream.range(0, values.size());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy