Example usage for java.util.stream LongStream builder

List of usage examples for java.util.stream LongStream builder

Introduction

In this page you can find the example usage for java.util.stream LongStream builder.

Prototype

public static Builder builder() 

Source Link

Document

Returns a builder for a LongStream .

Usage

From source file:Main.java

public static void main(String[] args) {
    LongStream.Builder b = LongStream.builder();
    b.add(1L).add(2L).add(3L).add(4L);/*from w  w w.ja v a2s  .c o  m*/

    b.build().forEach(System.out::println);
}

From source file:Main.java

public static void main(String[] args) {
    LongStream.Builder b = LongStream.builder();
    b.accept(1L);//  ww  w.j ava 2s  .com
    b.accept(2L);
    b.accept(3L);
    b.accept(4L);

    b.build().forEach(System.out::println);
}

From source file:Main.java

public static void main(String[] args) {
    LongStream.Builder b = LongStream.builder();
    b.accept(2L);/*  www.  j av a2  s.  c  o m*/
    b.accept(2L);
    b.accept(2L);

    LongStream s = b.build();
    s.forEach(System.out::println);
}

From source file:com.mgmtp.perfload.perfalyzer.binning.BinManager.java

/**
 * Creates a {@link java.util.stream.LongStream} with the bin counts as its source.
 *
 * @return the stream//from w  ww .  j a  v  a2  s  .  c  o  m
 */
public LongStream countStream() {
    Builder builder = LongStream.builder();
    bins.forEach(bin -> builder.add(bin.counter));
    return builder.build();
}