Example usage for java.util.function DoublePredicate test

List of usage examples for java.util.function DoublePredicate test

Introduction

In this page you can find the example usage for java.util.function DoublePredicate test.

Prototype

boolean test(double value);

Source Link

Document

Evaluates this predicate on the given argument.

Usage

From source file:at.gridtec.lambda4j.consumer.tri.obj.BiObjBooleanConsumer.java

/**
 * Returns a composed {@link TriDoubleConsumer} that first applies the {@code before} functions to its input, and
 * then applies this consumer 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 consumer is executed.
 *
 * @param before1 The first function to apply before this consumer is applied
 * @param before2 The second function to apply before this consumer is applied
 * @param before3 The third predicate to apply before this consumer is applied
 * @return A composed {@code TriDoubleConsumer} that first applies the {@code before} functions to its input, and
 * then applies this consumer 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  a  v  a  2s.  c  o  m*/
 */
@Nonnull
default TriDoubleConsumer composeFromDouble(@Nonnull final DoubleFunction<? extends T> before1,
        @Nonnull final DoubleFunction<? extends U> before2, @Nonnull final DoublePredicate before3) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    Objects.requireNonNull(before3);
    return (value1, value2, value3) -> accept(before1.apply(value1), before2.apply(value2),
            before3.test(value3));
}

From source file:at.gridtec.lambda4j.operator.ternary.DoubleTernaryOperator.java

/**
 * Returns a composed {@link TriDoublePredicate} that first applies this operator 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 operator to an operation returning {@code boolean}.
 *
 * @param after The predicate to apply after this operator is applied
 * @return A composed {@code TriDoublePredicate} that first applies this operator 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 ww . j ava2  s  . com
 */
@Nonnull
default TriDoublePredicate andThenToBoolean(@Nonnull final DoublePredicate after) {
    Objects.requireNonNull(after);
    return (value1, value2, value3) -> after.test(applyAsDouble(value1, value2, value3));
}

From source file:at.gridtec.lambda4j.function.bi.conversion.BiBooleanToIntFunction.java

/**
 * Returns a composed {@link BiDoubleToIntFunction} 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 BiDoubleToIntFunction} 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 ww  w . j  a v  a 2s.c o m
 */
@Nonnull
default BiDoubleToIntFunction composeFromDouble(@Nonnull final DoublePredicate before1,
        @Nonnull final DoublePredicate before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsInt(before1.test(value1), before2.test(value2));
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiBooleanToDoubleFunction.java

/**
 * Returns a composed {@link ObjBiBooleanPredicate} 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 ObjBiBooleanPredicate} 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}./*  ww  w. j a v a2 s  .co  m*/
 */
@Nonnull
default ObjBiBooleanPredicate<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.ObjBiByteToDoubleFunction.java

/**
 * Returns a composed {@link ObjBiBytePredicate} 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 ObjBiBytePredicate} 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}.// ww w .  j a  v  a 2 s  .  co  m
 */
@Nonnull
default ObjBiBytePredicate<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.ObjBiCharToDoubleFunction.java

/**
 * Returns a composed {@link ObjBiCharPredicate} 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 ObjBiCharPredicate} 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 ww  .  j  a  v  a 2 s .  c o m*/
 */
@Nonnull
default ObjBiCharPredicate<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.ObjBiDoubleToDoubleFunction.java

/**
 * Returns a composed {@link ObjBiDoublePredicate} 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 ObjBiDoublePredicate} 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 www. j  av  a 2  s . c  o m*/
 */
@Nonnull
default ObjBiDoublePredicate<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.ObjBiFloatToDoubleFunction.java

/**
 * Returns a composed {@link ObjBiFloatPredicate} 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 ObjBiFloatPredicate} 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 ava 2s  .  c  om
 */
@Nonnull
default ObjBiFloatPredicate<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.ObjBiShortToDoubleFunction.java

/**
 * Returns a composed {@link ObjBiShortPredicate} 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 ObjBiShortPredicate} 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   ww  w.j  a  va 2s  . c  o  m
 */
@Nonnull
default ObjBiShortPredicate<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.BiBooleanToByteFunction.java

/**
 * Returns a composed {@link BiDoubleToByteFunction} 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 BiDoubleToByteFunction} 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 a  v a  2  s  . com
 */
@Nonnull
default BiDoubleToByteFunction composeFromDouble(@Nonnull final DoublePredicate before1,
        @Nonnull final DoublePredicate before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsByte(before1.test(value1), before2.test(value2));
}