コード例 #1
0
 /**
  * Returns a composed {@link DoubleToFloatFunction} that first applies this predicate to its
  * input, and then applies the {@code after} function to the result. If evaluation of either
  * operation throws an exception, it is relayed to the caller of the composed operation. This
  * method is just convenience, to provide the ability to transform this primitive predicate to an
  * operation returning {@code float}.
  *
  * @param after The function to apply after this predicate is applied
  * @return A composed {@code DoubleToFloatFunction} that first applies this predicate to its
  *     input, and then applies the {@code after} function to the result.
  * @throws NullPointerException If given argument is {@code null}
  * @implSpec The input argument of this method is a able to return primitive values. In this case
  *     this is {@code float}.
  */
 @Nonnull
 default DoubleToFloatFunction andThenToFloat(@Nonnull final BooleanToFloatFunction after) {
   Objects.requireNonNull(after);
   return (value) -> after.applyAsFloat(test(value));
 }
コード例 #2
0
 /**
  * Creates a {@link BiBooleanToFloatFunction} which uses the {@code second} parameter of this one
  * as argument for the given {@link BooleanToFloatFunction}.
  *
  * @param function The function which accepts the {@code second} parameter of this one
  * @return Creates a {@code BiBooleanToFloatFunction} which uses the {@code second} parameter of
  *     this one as argument for the given {@code BooleanToFloatFunction}.
  * @throws NullPointerException If given argument is {@code null}
  */
 @Nonnull
 static BiBooleanToFloatFunction onlySecond(@Nonnull final BooleanToFloatFunction function) {
   Objects.requireNonNull(function);
   return (value1, value2) -> function.applyAsFloat(value2);
 }
コード例 #3
0
 /**
  * Returns a composed {@link ObjCharToFloatFunction} that first applies this predicate to its
  * input, and then applies the {@code after} function to the result. If evaluation of either
  * operation throws an exception, it is relayed to the caller of the composed operation. This
  * method is just convenience, to provide the ability to transform this primitive predicate to an
  * operation returning {@code float}.
  *
  * @param after The function to apply after this predicate is applied
  * @return A composed {@code ObjCharToFloatFunction} that first applies this predicate to its
  *     input, and then applies the {@code after} function to the result.
  * @throws NullPointerException If given argument is {@code null}
  * @implSpec The input argument of this method is a able to return primitive values. In this case
  *     this is {@code float}.
  */
 @Nonnull
 default ObjCharToFloatFunction<T> andThenToFloat(@Nonnull final BooleanToFloatFunction after) {
   Objects.requireNonNull(after);
   return (t, value) -> after.applyAsFloat(test(t, value));
 }