Package zone.lamprey.function
Interface BiFunction<T,U,R>
- Type Parameters:
T- the type of the first argument to the functionU- the type of the second argument to the functionR- the type of the result of the function
- All Superinterfaces:
BiFunction<T,U,R>
- All Known Subinterfaces:
BinaryOperator<T>,BiPredicate<T,U>,DoubleBinaryOperator,IntBinaryOperator,LongBinaryOperator,ToDoubleBiFunction<T,U>,ToIntBiFunction<T,U>,ToLongBiFunction<T,U>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface BiFunction<T,U,R> extends BiFunction<T,U,R>
Represents a function that accepts two arguments and produces a result. This
is the two-arity specialization of
Function.
This is a functional interface whose
functional method is apply(Object, Object).
- Since:
- 1.8
- See Also:
Function
-
Method Summary
Modifier and Type Method Description Rapply(T t, U u)Applies this function to the given arguments.default Supplier<R>applyPartial(T t, U u)Performs a partial application, resulting in a function that calls this with its argument and the argument given here.default Function<U,R>applyPartialL(T t)Performs a partial application, resulting in a function that calls this with its argument and the argument given here.default Function<T,R>applyPartialR(U u)Performs a partial application, resulting in a function that calls this with its argument and the argument given here.default BiConsumer<T,U>consume(Consumer<R> consumer)Consume a function.default <S> BiFunction<T,U,S>map(Function<? super R,? extends S> functor)Lift a function.default ToDoubleBiFunction<T,U>mapToDouble(ToDoubleFunction<? super R> functor)Lift a function.default ToIntBiFunction<T,U>mapToInt(ToIntFunction<? super R> functor)Lift a function.default ToLongBiFunction<T,U>mapToLong(ToLongFunction<? super R> functor)Lift a function.default BiPredicate<T,U>predicate(Predicate<? super R> functor)Lift a function.
-
Method Details
-
apply
Applies this function to the given arguments.- Specified by:
applyin interfaceBiFunction<T,U,R>- Parameters:
t- the first function argumentu- the second function argument- Returns:
- the function result
-
applyPartial
Performs a partial application, resulting in a function that calls this with its argument and the argument given here.- Parameters:
t- the first function argumentu- the second function argument- Returns:
- the function result
-
applyPartialL
Performs a partial application, resulting in a function that calls this with its argument and the argument given here.- Parameters:
t- the function argument- Returns:
- the function result
-
applyPartialR
Performs a partial application, resulting in a function that calls this with its argument and the argument given here.- Parameters:
u- the function argument- Returns:
- the function result
-
consume
Consume a function.- Parameters:
consumer- The consumer to use in consuming.- Returns:
- A Consumer which passes it's argument to this function and then passes the result into the given consumer.
-
predicate
Lift a function.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
map
Lift a function.- Type Parameters:
S- The return type.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToDouble
Lift a function.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToInt
Lift a function.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-
mapToLong
Lift a function.- Parameters:
functor- The function to use in lifting.- Returns:
- A function that passes the result of fn through a functor to produce a lifted function.
-