java.util.function.LongToIntFunction Java Examples
The following examples show how to use
java.util.function.LongToIntFunction.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LongPipeline.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #2
Source File: LongPipeline.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #3
Source File: LongPipeline.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #4
Source File: LongPipeline.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #5
Source File: LongPipeline.java From hottub with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #6
Source File: LongPipeline.java From Java8CN with Apache License 2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #7
Source File: LongPipeline.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #8
Source File: AlfrescoCoreAdminHandler.java From SearchServices with GNU Lesser General Public License v3.0 | 6 votes |
NamedList<Object> manageTransactionsToBeFixed( IOpenBitSet transactions, LongToIntFunction nodesCounter, Consumer<Long> scheduler, AtomicInteger limit) { final NamedList<Object> transactionsList = new SimpleOrderedMap<>(); long txid = -1; while ((txid = transactions.nextSetBit(txid + 1)) != -1 && limit.decrementAndGet() >= 0) { transactionsList.add(String.valueOf(txid), nodesCounter.applyAsInt(txid)); scheduler.accept(txid); } return transactionsList; }
Example #9
Source File: LongPipeline.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #10
Source File: LongPipeline.java From Bytecoder with Apache License 2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #11
Source File: LongPipeline.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #12
Source File: LongPipeline.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #13
Source File: LongPipeline.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #14
Source File: LongPipeline.java From desugar_jdk_libs with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #15
Source File: LongPipeline.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #16
Source File: LongPipeline.java From j2objc with Apache License 2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override public Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #17
Source File: LongPipeline.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #18
Source File: LongPipeline.java From JDKSourceCode1.8 with MIT License | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #19
Source File: LongPipeline.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #20
Source File: LongPipeline.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
@Override public final IntStream mapToInt(LongToIntFunction mapper) { Objects.requireNonNull(mapper); return new IntPipeline.StatelessOp<Long>(this, StreamShape.LONG_VALUE, StreamOpFlag.NOT_SORTED | StreamOpFlag.NOT_DISTINCT) { @Override Sink<Long> opWrapSink(int flags, Sink<Integer> sink) { return new Sink.ChainedLong<Integer>(sink) { @Override public void accept(long t) { downstream.accept(mapper.applyAsInt(t)); } }; } }; }
Example #21
Source File: LongStreamEx.java From streamex with Apache License 2.0 | 4 votes |
@Override public IntStreamEx mapToInt(LongToIntFunction mapper) { return new IntStreamEx(stream().mapToInt(mapper), context); }
Example #22
Source File: DefaultMethodStreams.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
@Override public IntStream mapToInt(LongToIntFunction mapper) { return s.mapToInt(mapper); }
Example #23
Source File: SenderEndPoints.java From artio with Apache License 2.0 | 4 votes |
public LongToIntFunction libraryLookup() { return libraryLookup; }
Example #24
Source File: LongStreamEx.java From streamex with Apache License 2.0 | 3 votes |
/** * Returns the maximum element of this stream according to the provided key * extractor function. * * <p> * This is a terminal operation. * * @param keyExtractor a non-interfering, stateless function * @return an {@code OptionalLong} describing the first element of this * stream for which the highest value was returned by key extractor, * or an empty {@code OptionalLong} if the stream is empty * @since 0.1.2 */ public OptionalLong maxByInt(LongToIntFunction keyExtractor) { return collect(PrimitiveBox::new, (box, l) -> { int key = keyExtractor.applyAsInt(l); if (!box.b || box.i < key) { box.b = true; box.i = key; box.l = l; } }, PrimitiveBox.MAX_INT).asLong(); }
Example #25
Source File: LongStreamEx.java From streamex with Apache License 2.0 | 3 votes |
/** * Returns the minimum element of this stream according to the provided key * extractor function. * * <p> * This is a terminal operation. * * @param keyExtractor a non-interfering, stateless function * @return an {@code OptionalLong} describing the first element of this * stream for which the lowest value was returned by key extractor, * or an empty {@code OptionalLong} if the stream is empty * @since 0.1.2 */ public OptionalLong minByInt(LongToIntFunction keyExtractor) { return collect(PrimitiveBox::new, (box, l) -> { int key = keyExtractor.applyAsInt(l); if (!box.b || box.i > key) { box.b = true; box.i = key; box.l = l; } }, PrimitiveBox.MIN_INT).asLong(); }
Example #26
Source File: LongStream.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 2 votes |
/** * Returns an {@code IntStream} consisting of the results of applying the * given function to the elements of this stream. * * <p>This is an <a href="package-summary.html#StreamOps">intermediate * operation</a>. * * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>, * <a href="package-summary.html#Statelessness">stateless</a> * function to apply to each element * @return the new stream */ IntStream mapToInt(LongToIntFunction mapper);
Example #27
Source File: LongStream.java From jdk8u_jdk with GNU General Public License v2.0 | 2 votes |
/** * Returns an {@code IntStream} consisting of the results of applying the * given function to the elements of this stream. * * <p>This is an <a href="package-summary.html#StreamOps">intermediate * operation</a>. * * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>, * <a href="package-summary.html#Statelessness">stateless</a> * function to apply to each element * @return the new stream */ IntStream mapToInt(LongToIntFunction mapper);
Example #28
Source File: LongStreamEx.java From streamex with Apache License 2.0 | 2 votes |
/** * Returns a stream consisting of the elements of this stream, sorted * according to the int values extracted by provided function. * * <p> * For ordered streams, the sort is stable. For unordered streams, no * stability guarantees are made. * * <p> * This is a <a href="package-summary.html#StreamOps">stateful intermediate * operation</a>. * * @param keyExtractor a * <a href="package-summary.html#NonInterference">non-interfering * </a>, <a href="package-summary.html#Statelessness">stateless</a> * function to be used to extract sorting keys * @return the new stream */ public LongStreamEx sortedByInt(LongToIntFunction keyExtractor) { return sorted(Comparator.comparingInt(keyExtractor::applyAsInt)); }
Example #29
Source File: LongStream.java From jdk8u-jdk with GNU General Public License v2.0 | 2 votes |
/** * Returns an {@code IntStream} consisting of the results of applying the * given function to the elements of this stream. * * <p>This is an <a href="package-summary.html#StreamOps">intermediate * operation</a>. * * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>, * <a href="package-summary.html#Statelessness">stateless</a> * function to apply to each element * @return the new stream */ IntStream mapToInt(LongToIntFunction mapper);
Example #30
Source File: LongStream.java From openjdk-8 with GNU General Public License v2.0 | 2 votes |
/** * Returns an {@code IntStream} consisting of the results of applying the * given function to the elements of this stream. * * <p>This is an <a href="package-summary.html#StreamOps">intermediate * operation</a>. * * @param mapper a <a href="package-summary.html#NonInterference">non-interfering</a>, * <a href="package-summary.html#Statelessness">stateless</a> * function to apply to each element * @return the new stream */ IntStream mapToInt(LongToIntFunction mapper);