Here you can find the source of printResults(Stream
Parameter | Description |
---|---|
resultPartitionsStream | a parameter |
public static <T> void printResults(Stream<Stream<T>> resultPartitionsStream)
//package com.java2s; //License from project: Apache License import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Stream; public class Main { /**//from ww w. j a v a 2 s . c om * Prints the resultPartitionsStream to the standard out * * @param resultPartitionsStream */ public static <T> void printResults(Stream<Stream<T>> resultPartitionsStream) { printResults(resultPartitionsStream, false); } /** * Prints the resultPartitionsStream to the standard out, also printing partition separator at the * start of each result partition if 'printPartitionSeparator' is set to <i>true</i>. * * @param resultPartitionsStream * @param printPartitionSeparator */ public static <T> void printResults(Stream<Stream<T>> resultPartitionsStream, boolean printPartitionSeparator) { AtomicInteger partitionCounter = new AtomicInteger(); resultPartitionsStream.forEach(resultPartition -> { if (printPartitionSeparator) { System.out.println("\n=> PARTITION:" + partitionCounter.getAndIncrement()); } resultPartition.forEach(System.out::println); }); } }