/** * Returns a {@link LongStream} containing the elements of the first stream, followed by the * elements of the second stream, and so on. * * <p>This is equivalent to {@code Stream.of(streams).flatMapToLong(stream -> stream)}, but the * returned stream may perform better. * * @see LongStream#concat(LongStream, LongStream) */ public static LongStream concat(LongStream... streams) { // TODO(lowasser): optimize this later return Stream.of(streams).flatMapToLong(stream -> stream); }
/** * Returns a {@link LongStream} containing the elements of the first stream, followed by the * elements of the second stream, and so on. * * <p>This is equivalent to {@code Stream.of(streams).flatMapToLong(stream -> stream)}, but the * returned stream may perform better. * * @see LongStream#concat(LongStream, LongStream) */ public static LongStream concat(LongStream... streams) { // TODO(lowasser): optimize this later return Stream.of(streams).flatMapToLong(stream -> stream); }
/** * Returns a {@link LongStream} containing the elements of the first stream, followed by the * elements of the second stream, and so on. * * <p>This is equivalent to {@code Stream.of(streams).flatMapToLong(stream -> stream)}, but the * returned stream may perform better. * * @see LongStream#concat(LongStream, LongStream) */ public static LongStream concat(LongStream... streams) { // TODO(lowasser): optimize this later return Stream.of(streams).flatMapToLong(stream -> stream); }
/** * Returns an {@code LongStream} consisting of the results of replacing each * element of this stream with the contents of a mapped stream produced by * applying the provided mapping function to each element. Each mapped * stream is {@link java.util.stream.BaseStream#close() closed} after its * contents have been placed into this stream. (If a mapped stream is * {@code null} an empty stream is used, instead.) * <p> * This is an intermediate operation. * * @param mapper a non-interfering, stateless function to apply to each * element which produces a stream of new elements * @return the new stream * * @see #flatMap(Function) */ @Override public LongStream flatMapToLong(Function<? super Map.Entry<K, V>, ? extends LongStream> mapper) { return inner.flatMapToLong(mapper); }
/** * Returns a {@link LongStream} containing the elements of the first stream, followed by the * elements of the second stream, and so on. * * <p>This is equivalent to {@code Stream.of(streams).flatMapToLong(stream -> stream)}, but the * returned stream may perform better. * * @see LongStream#concat(LongStream, LongStream) */ public static LongStream concat(LongStream... streams) { // TODO(lowasser): optimize this later return Stream.of(streams).flatMapToLong(stream -> stream); }
public FlatMapToLongAction(Function<? super T, ? extends LongStream> mapper) { super(s -> s.flatMapToLong(requireNonNull(mapper)), LongStream.class, FLAT_MAP_TO); }
/** * Will be used when there are too many proc wal files. We will rewrite the states of the active * procedures in the oldest proc wal file so that we can delete it. * @return all the active procedure ids in this tracker. */ public long[] getAllActiveProcIds() { return map.values().stream().map(BitSetNode::getActiveProcIds).filter(p -> p.length > 0) .flatMapToLong(LongStream::of).toArray(); }
@Override public LongStream events() throws IOException { return lines().flatMapToLong(line -> { String[] array = line.split(" ", 3); long startBlock = Long.parseLong(array[0]); int sequence = Integer.parseInt(array[1]); return LongStream.range(startBlock, startBlock + sequence); }); } }
@Override public LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper) { requireNonNull(mapper); if (STRICT) { return toStream().flatMapToLong(mapper); } return mapper.apply(element); }
/** * Returns an {@code LongStream} consisting of the results of replacing each * key-value pair of this stream with the contents of a mapped stream * produced by applying the provided mapping function to each element. Each * mapped stream is {@link java.util.stream.BaseStream#close() closed} after * its contents have been placed into this stream. (If a mapped stream is * {@code null} an empty stream is used, instead.) * <p> * This is an intermediate operation. * * @param mapper a non-interfering, stateless function to apply to each * key-value pair which produces a stream of new elements * @return the new stream * * @see #flatMap(Function) */ public LongStream flatMapToLong(BiFunction<? super K, ? super V, ? extends LongStream> mapper) { return inner.flatMapToLong(e -> mapper.apply(e.getKey(), e.getValue())); }
@Override public LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper) { requireNonNull(mapper); return materialize().flatMapToLong(mapper); }
/** * Gets a stream of values from a collection of range resources. */ public static LongStream rangeValues(Collection<Protos.Resource> resources) { checkNotNull(resources); return resources.stream() .filter(Protos.Resource::hasRanges) .flatMap(r -> r.getRanges().getRangeList().stream()) .flatMapToLong(Utils::rangeValues); }
@Override public LongStream build(boolean parallel) { return previous().build(parallel).flatMapToLong(mapper); } }
@Override public LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper) { return wrap(stream().flatMapToLong(mapper)); }
@Override public LongStream events() throws IOException { return lines().flatMapToLong(line -> { String[] array = line.split(",", 5); if (array.length <= 4) { return LongStream.empty(); } long startBlock = Long.parseLong(array[1]); int size = Integer.parseInt(array[2]); int sequence = IntMath.divide(size, BLOCK_SIZE, RoundingMode.UP); char readWrite = Character.toLowerCase(array[3].charAt(0)); return (readWrite == 'w') ? LongStream.empty() : LongStream.range(startBlock, startBlock + sequence); }); } }
@Override public LongStream flatMapToLong( Function<? super T, ? extends LongStream> mapper) { realizeStream(); return wrappedStream.flatMapToLong(mapper); }
@Override public LongStream flatMapToLong(final Function<? super T, ? extends LongStream> mapper) { return unwrapStream().flatMapToLong(mapper); }
@Override public LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper) { return stream().flatMapToLong(mapper); }
@Override public LongStream flatMapToLong( final Function<? super T, ? extends LongStream> mapper ) { return _self.flatMapToLong(mapper); }
@Override public LongStream flatMapToLong( Function<? super Entry<K, V>, ? extends LongStream> mapper) { return delegate.flatMapToLong(mapper); }