List of usage examples for java.util.function DoublePredicate test
boolean test(double value);
From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToCharFunction.java
/** * Returns a composed {@link BiDoubleToCharFunction} that first applies the {@code before} predicates to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first predicate to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiDoubleToCharFunction} that first applies the {@code before} predicates to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}./* w w w . ja v a 2 s . c o m*/ */ @Nonnull default BiDoubleToCharFunction composeFromDouble(@Nonnull final DoublePredicate before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsChar(before1.test(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToLongFunction.java
/** * Returns a composed {@link BiDoubleToLongFunction} that first applies the {@code before} predicates to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first predicate to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiDoubleToLongFunction} that first applies the {@code before} predicates to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}./* ww w . j ava 2 s. co m*/ */ @Nonnull default BiDoubleToLongFunction composeFromDouble(@Nonnull final DoublePredicate before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsLong(before1.test(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiIntToDoubleFunction.java
/** * Returns a composed {@link ObjBiIntPredicate} that first applies this function to its input, and then applies the * {@code after} predicate 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 function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code ObjBiIntPredicate} that first applies this function to its input, and then applies the * {@code after} predicate 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 * boolean}./* w w w.ja va 2 s . co m*/ */ @Nonnull default ObjBiIntPredicate<T> andThenToBoolean(@Nonnull final DoublePredicate after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.test(applyAsDouble(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiLongToDoubleFunction.java
/** * Returns a composed {@link ObjBiLongPredicate} that first applies this function to its input, and then applies the * {@code after} predicate 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 function to an operation returning {@code boolean}. * * @param after The predicate to apply after this function is applied * @return A composed {@code ObjBiLongPredicate} that first applies this function to its input, and then applies the * {@code after} predicate 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 * boolean}./*from w w w.j av a 2s.c o m*/ */ @Nonnull default ObjBiLongPredicate<T> andThenToBoolean(@Nonnull final DoublePredicate after) { Objects.requireNonNull(after); return (t, value1, value2) -> after.test(applyAsDouble(t, value1, value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToFloatFunction.java
/** * Returns a composed {@link BiDoubleToFloatFunction} that first applies the {@code before} predicates to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first predicate to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiDoubleToFloatFunction} that first applies the {@code before} predicates to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}./*from w w w. jav a2 s . co m*/ */ @Nonnull default BiDoubleToFloatFunction composeFromDouble(@Nonnull final DoublePredicate before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsFloat(before1.test(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToShortFunction.java
/** * Returns a composed {@link BiDoubleToShortFunction} that first applies the {@code before} predicates to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first predicate to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiDoubleToShortFunction} that first applies the {@code before} predicates to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}./*from w w w . j a va 2 s. co m*/ */ @Nonnull default BiDoubleToShortFunction composeFromDouble(@Nonnull final DoublePredicate before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsShort(before1.test(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToDoubleFunction.java
/** * Returns a composed {@link DoubleBinaryOperator2} that first applies the {@code before} predicates to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first predicate to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code DoubleBinaryOperator2} that first applies the {@code before} predicates to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}./* w w w . j av a 2 s. c o m*/ */ @Nonnull default DoubleBinaryOperator2 composeFromDouble(@Nonnull final DoublePredicate before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsDouble(before1.test(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToByteFunction.java
/** * Returns a composed {@link BiDoubleToByteFunction} that first applies the {@code before} functions to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first function to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiDoubleToByteFunction} that first applies the {@code before} functions to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}./*from w w w. j a va 2 s . c om*/ */ @Nonnull default BiDoubleToByteFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsByte(before1.apply(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToCharFunction.java
/** * Returns a composed {@link BiDoubleToCharFunction} that first applies the {@code before} functions to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first function to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiDoubleToCharFunction} that first applies the {@code before} functions to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}.//from www. j av a2s . c o m */ @Nonnull default BiDoubleToCharFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsChar(before1.apply(value1), before2.test(value2)); }
From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToIntFunction.java
/** * Returns a composed {@link BiDoubleToIntFunction} that first applies the {@code before} functions to its input, * and then applies this 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 * execute an operation which accepts {@code double} input, before this primitive function is executed. * * @param before1 The first function to apply before this function is applied * @param before2 The second predicate to apply before this function is applied * @return A composed {@code BiDoubleToIntFunction} that first applies the {@code before} functions to its input, * and then applies this function to the result. * @throws NullPointerException If given argument is {@code null} * @implSpec The input argument of this method is a able to handle primitive values. In this case this is {@code * double}./*w w w .jav a 2 s .c o m*/ */ @Nonnull default BiDoubleToIntFunction composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1, @Nonnull final DoublePredicate before2) { Objects.requireNonNull(before1); Objects.requireNonNull(before2); return (value1, value2) -> applyAsInt(before1.apply(value1), before2.test(value2)); }