Loading core/java/com/android/internal/util/function/pooled/OmniFunction.java +2 −17 Original line number Diff line number Diff line Loading @@ -51,13 +51,13 @@ import java.util.function.Function; * @hide */ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements PooledFunction<A, R>, BiFunction<A, B, R>, TriFunction<A, B, C, R>, BiFunction<A, B, R>, TriFunction<A, B, C, R>, QuadFunction<A, B, C, D, R>, QuintFunction<A, B, C, D, E, R>, HexFunction<A, B, C, D, E, F, R>, HeptFunction<A, B, C, D, E, F, G, R>, OctFunction<A, B, C, D, E, F, G, H, R>, NonaFunction<A, B, C, D, E, F, G, H, I, R>, DecFunction<A, B, C, D, E, F, G, H, I, J, R>, UndecFunction<A, B, C, D, E, F, G, H, I, J, K, R>, PooledConsumer<A>, BiConsumer<A, B>, TriConsumer<A, B, C>, QuadConsumer<A, B, C, D>, BiConsumer<A, B>, TriConsumer<A, B, C>, QuadConsumer<A, B, C, D>, QuintConsumer<A, B, C, D, E>, HexConsumer<A, B, C, D, E, F>, HeptConsumer<A, B, C, D, E, F, G>, OctConsumer<A, B, C, D, E, F, G, H>, NonaConsumer<A, B, C, D, E, F, G, H, I>, DecConsumer<A, B, C, D, E, F, G, H, I, J>, Loading @@ -73,11 +73,6 @@ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements return invoke(o, o2, null, null, null, null, null, null, null, null, null); } @Override public R apply(A o) { return invoke(o, null, null, null, null, null, null, null, null, null, null); } public abstract <V> OmniFunction<A, B, C, D, E, F, G, H, I, J, K, V> andThen( Function<? super R, ? extends V> after); public abstract OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> negate(); Loading @@ -87,11 +82,6 @@ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements invoke(o, o2, null, null, null, null, null, null, null, null, null); } @Override public void accept(A o) { invoke(o, null, null, null, null, null, null, null, null, null, null); } @Override public void run() { invoke(null, null, null, null, null, null, null, null, null, null, null); Loading Loading @@ -132,11 +122,6 @@ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements return this; } @Override public PooledConsumer<A> asConsumer() { return this; } @Override public R apply(A a, B b, C c) { return invoke(a, b, c, null, null, null, null, null, null, null, null); Loading core/java/com/android/internal/util/function/pooled/PooledConsumer.javadeleted 100644 → 0 +0 −31 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util.function.pooled; import java.util.function.Consumer; /** * {@link Consumer} + {@link PooledLambda} * * @see PooledLambda * @hide */ public interface PooledConsumer<T> extends PooledLambda, Consumer<T> { /** @inheritDoc */ PooledConsumer<T> recycleOnUse(); } core/java/com/android/internal/util/function/pooled/PooledFunction.javadeleted 100644 → 0 +0 −36 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util.function.pooled; import java.util.function.Function; /** * {@link Function} + {@link PooledLambda} * * @see PooledLambda * @hide */ public interface PooledFunction<A, R> extends PooledLambda, Function<A, R> { /** * Ignores the result */ PooledConsumer<A> asConsumer(); /** @inheritDoc */ PooledFunction<A, R> recycleOnUse(); } core/java/com/android/internal/util/function/pooled/PooledLambda.java +0 −173 Original line number Diff line number Diff line Loading @@ -232,24 +232,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 placeholder for a missing argument. Use {@link #__} to get one * @param arg2 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg1) -> function(arg1, arg2) } */ static <A, B> PooledConsumer<A> obtainConsumer( BiConsumer<? super A, ? super B> function, ArgumentPlaceholder<A> arg1, B arg2) { return acquire(PooledLambdaImpl.sPool, function, 2, 1, ReturnType.VOID, arg1, arg2, null, null, null, null, null, null, null, null, null, null); } /** * {@link PooledPredicate} factory * Loading Loading @@ -328,24 +310,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 placeholder for a missing argument. Use {@link #__} to get one * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg2) -> function(arg1, arg2) } */ static <A, B> PooledConsumer<B> obtainConsumer( BiConsumer<? super A, ? super B> function, A arg1, ArgumentPlaceholder<B> arg2) { return acquire(PooledLambdaImpl.sPool, function, 2, 1, ReturnType.VOID, arg1, arg2, null, null, null, null, null, null, null, null, null, null); } /** * {@link PooledPredicate} factory * Loading Loading @@ -417,63 +381,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 placeholder for a missing argument. Use {@link #__} to get one * @param arg2 parameter supplied to {@code function} on call * @param arg3 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg1) -> function(arg1, arg2, arg3) } */ static <A, B, C> PooledConsumer<A> obtainConsumer( TriConsumer<? super A, ? super B, ? super C> function, ArgumentPlaceholder<A> arg1, B arg2, C arg3) { return acquire(PooledLambdaImpl.sPool, function, 3, 1, ReturnType.VOID, arg1, arg2, arg3, null, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 placeholder for a missing argument. Use {@link #__} to get one * @param arg3 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg2) -> function(arg1, arg2, arg3) } */ static <A, B, C> PooledConsumer<B> obtainConsumer( TriConsumer<? super A, ? super B, ? super C> function, A arg1, ArgumentPlaceholder<B> arg2, C arg3) { return acquire(PooledLambdaImpl.sPool, function, 3, 1, ReturnType.VOID, arg1, arg2, arg3, null, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 parameter supplied to {@code function} on call * @param arg3 placeholder for a missing argument. Use {@link #__} to get one * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg3) -> function(arg1, arg2, arg3) } */ static <A, B, C> PooledConsumer<C> obtainConsumer( TriConsumer<? super A, ? super B, ? super C> function, A arg1, B arg2, ArgumentPlaceholder<C> arg3) { return acquire(PooledLambdaImpl.sPool, function, 3, 1, ReturnType.VOID, arg1, arg2, arg3, null, null, null, null, null, null, null, null, null); } /** * Factory of {@link Message}s that contain an * ({@link PooledLambda#recycleOnUse auto-recycling}) {@link PooledRunnable} as its Loading Loading @@ -529,86 +436,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 placeholder for a missing argument. Use {@link #__} to get one * @param arg2 parameter supplied to {@code function} on call * @param arg3 parameter supplied to {@code function} on call * @param arg4 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg1) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<A> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, ArgumentPlaceholder<A> arg1, B arg2, C arg3, D arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 placeholder for a missing argument. Use {@link #__} to get one * @param arg3 parameter supplied to {@code function} on call * @param arg4 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg2) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<B> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, A arg1, ArgumentPlaceholder<B> arg2, C arg3, D arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 parameter supplied to {@code function} on call * @param arg3 placeholder for a missing argument. Use {@link #__} to get one * @param arg4 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg3) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<C> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, A arg1, B arg2, ArgumentPlaceholder<C> arg3, D arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 parameter supplied to {@code function} on call * @param arg3 parameter supplied to {@code function} on call * @param arg4 placeholder for a missing argument. Use {@link #__} to get one * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg4) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<D> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, A arg1, B arg2, C arg3, ArgumentPlaceholder<D> arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * Factory of {@link Message}s that contain an * ({@link PooledLambda#recycleOnUse auto-recycling}) {@link PooledRunnable} as its Loading core/java/com/android/internal/util/function/pooled/PooledPredicate.java +0 −5 Original line number Diff line number Diff line Loading @@ -26,11 +26,6 @@ import java.util.function.Predicate; */ public interface PooledPredicate<T> extends PooledLambda, Predicate<T> { /** * Ignores the result */ PooledConsumer<T> asConsumer(); /** @inheritDoc */ PooledPredicate<T> recycleOnUse(); } Loading
core/java/com/android/internal/util/function/pooled/OmniFunction.java +2 −17 Original line number Diff line number Diff line Loading @@ -51,13 +51,13 @@ import java.util.function.Function; * @hide */ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements PooledFunction<A, R>, BiFunction<A, B, R>, TriFunction<A, B, C, R>, BiFunction<A, B, R>, TriFunction<A, B, C, R>, QuadFunction<A, B, C, D, R>, QuintFunction<A, B, C, D, E, R>, HexFunction<A, B, C, D, E, F, R>, HeptFunction<A, B, C, D, E, F, G, R>, OctFunction<A, B, C, D, E, F, G, H, R>, NonaFunction<A, B, C, D, E, F, G, H, I, R>, DecFunction<A, B, C, D, E, F, G, H, I, J, R>, UndecFunction<A, B, C, D, E, F, G, H, I, J, K, R>, PooledConsumer<A>, BiConsumer<A, B>, TriConsumer<A, B, C>, QuadConsumer<A, B, C, D>, BiConsumer<A, B>, TriConsumer<A, B, C>, QuadConsumer<A, B, C, D>, QuintConsumer<A, B, C, D, E>, HexConsumer<A, B, C, D, E, F>, HeptConsumer<A, B, C, D, E, F, G>, OctConsumer<A, B, C, D, E, F, G, H>, NonaConsumer<A, B, C, D, E, F, G, H, I>, DecConsumer<A, B, C, D, E, F, G, H, I, J>, Loading @@ -73,11 +73,6 @@ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements return invoke(o, o2, null, null, null, null, null, null, null, null, null); } @Override public R apply(A o) { return invoke(o, null, null, null, null, null, null, null, null, null, null); } public abstract <V> OmniFunction<A, B, C, D, E, F, G, H, I, J, K, V> andThen( Function<? super R, ? extends V> after); public abstract OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> negate(); Loading @@ -87,11 +82,6 @@ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements invoke(o, o2, null, null, null, null, null, null, null, null, null); } @Override public void accept(A o) { invoke(o, null, null, null, null, null, null, null, null, null, null); } @Override public void run() { invoke(null, null, null, null, null, null, null, null, null, null, null); Loading Loading @@ -132,11 +122,6 @@ abstract class OmniFunction<A, B, C, D, E, F, G, H, I, J, K, R> implements return this; } @Override public PooledConsumer<A> asConsumer() { return this; } @Override public R apply(A a, B b, C c) { return invoke(a, b, c, null, null, null, null, null, null, null, null); Loading
core/java/com/android/internal/util/function/pooled/PooledConsumer.javadeleted 100644 → 0 +0 −31 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util.function.pooled; import java.util.function.Consumer; /** * {@link Consumer} + {@link PooledLambda} * * @see PooledLambda * @hide */ public interface PooledConsumer<T> extends PooledLambda, Consumer<T> { /** @inheritDoc */ PooledConsumer<T> recycleOnUse(); }
core/java/com/android/internal/util/function/pooled/PooledFunction.javadeleted 100644 → 0 +0 −36 Original line number Diff line number Diff line /* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.util.function.pooled; import java.util.function.Function; /** * {@link Function} + {@link PooledLambda} * * @see PooledLambda * @hide */ public interface PooledFunction<A, R> extends PooledLambda, Function<A, R> { /** * Ignores the result */ PooledConsumer<A> asConsumer(); /** @inheritDoc */ PooledFunction<A, R> recycleOnUse(); }
core/java/com/android/internal/util/function/pooled/PooledLambda.java +0 −173 Original line number Diff line number Diff line Loading @@ -232,24 +232,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 placeholder for a missing argument. Use {@link #__} to get one * @param arg2 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg1) -> function(arg1, arg2) } */ static <A, B> PooledConsumer<A> obtainConsumer( BiConsumer<? super A, ? super B> function, ArgumentPlaceholder<A> arg1, B arg2) { return acquire(PooledLambdaImpl.sPool, function, 2, 1, ReturnType.VOID, arg1, arg2, null, null, null, null, null, null, null, null, null, null); } /** * {@link PooledPredicate} factory * Loading Loading @@ -328,24 +310,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 placeholder for a missing argument. Use {@link #__} to get one * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg2) -> function(arg1, arg2) } */ static <A, B> PooledConsumer<B> obtainConsumer( BiConsumer<? super A, ? super B> function, A arg1, ArgumentPlaceholder<B> arg2) { return acquire(PooledLambdaImpl.sPool, function, 2, 1, ReturnType.VOID, arg1, arg2, null, null, null, null, null, null, null, null, null, null); } /** * {@link PooledPredicate} factory * Loading Loading @@ -417,63 +381,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 placeholder for a missing argument. Use {@link #__} to get one * @param arg2 parameter supplied to {@code function} on call * @param arg3 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg1) -> function(arg1, arg2, arg3) } */ static <A, B, C> PooledConsumer<A> obtainConsumer( TriConsumer<? super A, ? super B, ? super C> function, ArgumentPlaceholder<A> arg1, B arg2, C arg3) { return acquire(PooledLambdaImpl.sPool, function, 3, 1, ReturnType.VOID, arg1, arg2, arg3, null, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 placeholder for a missing argument. Use {@link #__} to get one * @param arg3 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg2) -> function(arg1, arg2, arg3) } */ static <A, B, C> PooledConsumer<B> obtainConsumer( TriConsumer<? super A, ? super B, ? super C> function, A arg1, ArgumentPlaceholder<B> arg2, C arg3) { return acquire(PooledLambdaImpl.sPool, function, 3, 1, ReturnType.VOID, arg1, arg2, arg3, null, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 parameter supplied to {@code function} on call * @param arg3 placeholder for a missing argument. Use {@link #__} to get one * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg3) -> function(arg1, arg2, arg3) } */ static <A, B, C> PooledConsumer<C> obtainConsumer( TriConsumer<? super A, ? super B, ? super C> function, A arg1, B arg2, ArgumentPlaceholder<C> arg3) { return acquire(PooledLambdaImpl.sPool, function, 3, 1, ReturnType.VOID, arg1, arg2, arg3, null, null, null, null, null, null, null, null, null); } /** * Factory of {@link Message}s that contain an * ({@link PooledLambda#recycleOnUse auto-recycling}) {@link PooledRunnable} as its Loading Loading @@ -529,86 +436,6 @@ public interface PooledLambda { null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 placeholder for a missing argument. Use {@link #__} to get one * @param arg2 parameter supplied to {@code function} on call * @param arg3 parameter supplied to {@code function} on call * @param arg4 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg1) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<A> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, ArgumentPlaceholder<A> arg1, B arg2, C arg3, D arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 placeholder for a missing argument. Use {@link #__} to get one * @param arg3 parameter supplied to {@code function} on call * @param arg4 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg2) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<B> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, A arg1, ArgumentPlaceholder<B> arg2, C arg3, D arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 parameter supplied to {@code function} on call * @param arg3 placeholder for a missing argument. Use {@link #__} to get one * @param arg4 parameter supplied to {@code function} on call * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg3) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<C> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, A arg1, B arg2, ArgumentPlaceholder<C> arg3, D arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * {@link PooledConsumer} factory * * @param function non-capturing lambda(typically an unbounded method reference) * to be invoked on call * @param arg1 parameter supplied to {@code function} on call * @param arg2 parameter supplied to {@code function} on call * @param arg3 parameter supplied to {@code function} on call * @param arg4 placeholder for a missing argument. Use {@link #__} to get one * @return a {@link PooledConsumer}, equivalent to lambda: * {@code (arg4) -> function(arg1, arg2, arg3, arg4) } */ static <A, B, C, D> PooledConsumer<D> obtainConsumer( QuadConsumer<? super A, ? super B, ? super C, ? super D> function, A arg1, B arg2, C arg3, ArgumentPlaceholder<D> arg4) { return acquire(PooledLambdaImpl.sPool, function, 4, 1, ReturnType.VOID, arg1, arg2, arg3, arg4, null, null, null, null, null, null, null, null); } /** * Factory of {@link Message}s that contain an * ({@link PooledLambda#recycleOnUse auto-recycling}) {@link PooledRunnable} as its Loading
core/java/com/android/internal/util/function/pooled/PooledPredicate.java +0 −5 Original line number Diff line number Diff line Loading @@ -26,11 +26,6 @@ import java.util.function.Predicate; */ public interface PooledPredicate<T> extends PooledLambda, Predicate<T> { /** * Ignores the result */ PooledConsumer<T> asConsumer(); /** @inheritDoc */ PooledPredicate<T> recycleOnUse(); }