JAVA_IIBRARY Telegram 1427
Как работает FlatMap в Java?

Mapping


Из исходного потока каждый элемент проходит через функцию, которая возвращает новый поток.

Это отличается от map(), так как здесь функция возвращает потоки, а не отдельные значения.

Flattening

Поскольку на предыдущем шаге мы получили несколько потоков, этот шаг просто объединяет их в один поток.

Синтаксис и параметры
для flatMap():

<R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> mapper)


> R — тип элементов в результирующем потоке.
> T — тип элементов во входном потоке.
> mapper — функция, которая преобразует элемент типа T во входном потоке в поток элементов типа R.

👉 Java Portal
Please open Telegram to view this post
VIEW IN TELEGRAM



tgoop.com/Java_Iibrary/1427
Create:
Last Update:

Как работает FlatMap в Java?

Mapping


Из исходного потока каждый элемент проходит через функцию, которая возвращает новый поток.

Это отличается от map(), так как здесь функция возвращает потоки, а не отдельные значения.

Flattening

Поскольку на предыдущем шаге мы получили несколько потоков, этот шаг просто объединяет их в один поток.

Синтаксис и параметры
для flatMap():

<R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends R>> mapper)


> R — тип элементов в результирующем потоке.
> T — тип элементов во входном потоке.
> mapper — функция, которая преобразует элемент типа T во входном потоке в поток элементов типа R.

👉 Java Portal

BY Java Portal | Программирование




Share with your friend now:
tgoop.com/Java_Iibrary/1427

View MORE
Open in Telegram


Telegram News

Date: |

The creator of the channel becomes its administrator by default. If you need help managing your channel, you can add more administrators from your subscriber base. You can provide each admin with limited or full rights to manage the channel. For example, you can allow an administrator to publish and edit content while withholding the right to add new subscribers. In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. The court said the defendant had also incited people to commit public nuisance, with messages calling on them to take part in rallies and demonstrations including at Hong Kong International Airport, to block roads and to paralyse the public transportation system. Various forms of protest promoted on the messaging platform included general strikes, lunchtime protests and silent sit-ins. With Bitcoin down 30% in the past week, some crypto traders have taken to Telegram to “voice” their feelings. Step-by-step tutorial on desktop:
from us


Telegram Java Portal | Программирование
FROM American