Package io.github.jonestimd.util
Class Streams
- java.lang.Object
-
- io.github.jonestimd.util.Streams
-
public class Streams extends java.lang.Object
Utility methods for streams.
-
-
Constructor Summary
Constructors Constructor Description Streams()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> java.util.List<T>
filter(java.lang.Iterable<T> list, java.util.function.Predicate<? super T> predicate)
static <R> java.util.List<R>
map(int[] source, java.util.function.IntFunction<? extends R> transform)
static <T,R>
java.util.List<R>map(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,? extends R> transform)
static <T,R>
java.util.List<R>map(java.util.Collection<T> collection, java.util.function.Function<? super T,? extends R> transform)
static <T,R>
java.util.List<R>map(java.util.stream.Stream<T> stream, java.util.function.Function<? super T,? extends R> transform)
static <T> java.util.stream.Stream<T>
of(java.lang.Iterable<T> iterable)
static java.util.stream.IntStream
reverseRange(int endExclusive, int start)
static java.math.BigDecimal
sum(java.util.stream.Stream<java.math.BigDecimal> stream)
static <T> java.util.List<T>
toList(java.lang.Iterable<T> iterable)
static <T,R>
java.util.Set<R>unique(java.util.Collection<T> collection, java.util.function.Function<? super T,? extends R> transform)
static <T,R>
java.util.Set<R>unique(java.util.stream.Stream<T> stream, java.util.function.Function<? super T,? extends R> transform)
static <K,V>
java.util.Map<K,V>uniqueIndex(java.util.Collection<V> collection, java.util.function.Function<? super V,? extends K> keyFunction)
static <K,V>
java.util.Map<K,V>uniqueIndex(java.util.stream.Stream<V> stream, java.util.function.Function<? super V,? extends K> keyFunction)
-
-
-
Method Detail
-
of
public static <T> java.util.stream.Stream<T> of(java.lang.Iterable<T> iterable)
-
toList
public static <T> java.util.List<T> toList(java.lang.Iterable<T> iterable)
-
map
public static <T,R> java.util.List<R> map(java.lang.Iterable<T> iterable, java.util.function.Function<? super T,? extends R> transform)
-
map
public static <T,R> java.util.List<R> map(java.util.Collection<T> collection, java.util.function.Function<? super T,? extends R> transform)
-
map
public static <T,R> java.util.List<R> map(java.util.stream.Stream<T> stream, java.util.function.Function<? super T,? extends R> transform)
-
map
public static <R> java.util.List<R> map(int[] source, java.util.function.IntFunction<? extends R> transform)
-
filter
public static <T> java.util.List<T> filter(java.lang.Iterable<T> list, java.util.function.Predicate<? super T> predicate)
-
unique
public static <T,R> java.util.Set<R> unique(java.util.Collection<T> collection, java.util.function.Function<? super T,? extends R> transform)
-
unique
public static <T,R> java.util.Set<R> unique(java.util.stream.Stream<T> stream, java.util.function.Function<? super T,? extends R> transform)
-
uniqueIndex
public static <K,V> java.util.Map<K,V> uniqueIndex(java.util.Collection<V> collection, java.util.function.Function<? super V,? extends K> keyFunction)
-
uniqueIndex
public static <K,V> java.util.Map<K,V> uniqueIndex(java.util.stream.Stream<V> stream, java.util.function.Function<? super V,? extends K> keyFunction)
-
sum
public static java.math.BigDecimal sum(java.util.stream.Stream<java.math.BigDecimal> stream)
-
reverseRange
public static java.util.stream.IntStream reverseRange(int endExclusive, int start)
-
-