Modifier and Type | Method and Description |
---|---|
static <T> Stream<Map.Entry<Integer,T>> |
indexed(Stream<T> stream)
Maps elements of
stream to entries with index and the original value. |
static <T> Stream<Map.Entry<Long,T>> |
indexedLong(Stream<T> stream)
Maps elements of
stream to entries with index of type long and the
original value. |
public static <T> Stream<Map.Entry<Integer,T>> indexed(Stream<T> stream)
stream
to entries with index and the original value.
The first elements index is zero. In case of an integer overflow an
ArithmeticException
is thrown.
T
- the type of the input stream elementsstream
- the input streamArithmeticException
- Stream index overflowpublic static <T> Stream<Map.Entry<Long,T>> indexedLong(Stream<T> stream)
stream
to entries with index of type long and the
original value.
The first elements index is zero. In case of an overflow an
ArithmeticException
is thrown.
T
- the type of the input stream elementsstream
- the input streamArithmeticException
- Stream index overflowCopyright © 2025. All rights reserved.