Interface DoubleConsumer
- All Superinterfaces:
DoubleConsumer
An enhanced long consumer.
- Author:
- Paul Ferraro
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DoubleConsumerConsumer that discards its parameter -
Method Summary
Modifier and TypeMethodDescriptionstatic DoubleConsumeracceptAll(Iterable<? extends DoubleConsumer> consumers) Returns a composite consumer that delegates to the specified consumers.default DoubleConsumerandThen(DoubleConsumer after) boxed()Returns a boxed version of this consumer.default <V1,V2> BiConsumer <V1, V2> compose(ToDoubleBiFunction<V1, V2> composer) Composes a binary consumer that invokes this consumer using result of the specified binary function.default <V> Consumer<V> compose(ToDoubleFunction<V> composer) Composes a consumer that invokes this consumer using result of the specified function.default DoubleConsumercomposeAsDouble(DoubleUnaryOperator composer) Composes a consumer that invokes this consumer using result of the specified function.default <R> DoubleFunction<R> thenReturn(Supplier<R> factory) Returns a function that returns the value from the specified supplier after accepting its parameter via this consumer.default DoubleUnaryOperatorthenReturnDouble(DoubleSupplier factory) Returns a function that returns the value from the specified supplier after accepting its parameter via this consumer.default DoubleConsumerwhen(DoublePredicate predicate) Returns a consumer that conditionally invokes this consumer when allowed by the specified predicate.default DoubleConsumerwithDefault(DoublePredicate predicate, DoubleSupplier defaultValue) Returns a consumer that accepts the value returned by the specified default provider if its value does not match the specified predicate.Methods inherited from interface DoubleConsumer
accept
-
Field Details
-
EMPTY
Consumer that discards its parameter
-
-
Method Details
-
andThen
- Specified by:
andThenin interfaceDoubleConsumer
-
boxed
-
when
Returns a consumer that conditionally invokes this consumer when allowed by the specified predicate.- Parameters:
predicate- a predicate that determines whether or not to invoke this consumer- Returns:
- a consumer that conditionally invokes this consumer when allowed by the specified predicate.
-
withDefault
Returns a consumer that accepts the value returned by the specified default provider if its value does not match the specified predicate.- Parameters:
predicate- a predicate used to determine the parameter of this consumerdefaultValue- a provider of the default parameter value- Returns:
- a consumer that accepts the value returned by the specified default provider if its value does not match the specified predicate.
-
composeAsDouble
Composes a consumer that invokes this consumer using result of the specified function.- Parameters:
composer- a composing function- Returns:
- a composed consumer
-
compose
Composes a consumer that invokes this consumer using result of the specified function.- Type Parameters:
V- the mapped type- Parameters:
composer- a composing function- Returns:
- a composed consumer
-
compose
Composes a binary consumer that invokes this consumer using result of the specified binary function.- Type Parameters:
V1- the former parameter typeV2- the latter parameter type- Parameters:
composer- a composing function- Returns:
- a binary consumer that invokes this consumer using result of the specified binary function.
-
thenReturn
Returns a function that returns the value from the specified supplier after accepting its parameter via this consumer.- Type Parameters:
R- the return type- Parameters:
factory- a factory of the function return value- Returns:
- a function that returns the value from the specified supplier after accepting its parameter via this consumer.
-
thenReturnDouble
Returns a function that returns the value from the specified supplier after accepting its parameter via this consumer.- Parameters:
factory- a factory of the function return value- Returns:
- a function that returns the value from the specified supplier after accepting its parameter via this consumer.
-
acceptAll
Returns a composite consumer that delegates to the specified consumers.- Parameters:
consumers- a number of consumers- Returns:
- a composite consumer
-