Example usage for java.util.function DoubleToIntFunction applyAsInt

List of usage examples for java.util.function DoubleToIntFunction applyAsInt

Introduction

In this page you can find the example usage for java.util.function DoubleToIntFunction applyAsInt.

Prototype

int applyAsInt(double value);

Source Link

Document

Applies this function to the given argument.

Usage

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

/**
 * Returns a composed {@link BiLongToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code BiLongToIntFunction} that first applies this function 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
 * int}./* w w w .ja  v  a2 s .com*/
 */
@Nonnull
default BiLongToIntFunction andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsInt(applyAsDouble(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToDoubleFunction.java

/**
 * Returns a composed {@link ObjDoubleToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjDoubleToIntFunction} that first applies this function 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
 * int}./*  w ww  . ja v  a 2 s  . c  o m*/
 */
@Nonnull
default ObjDoubleToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToDoubleFunction.java

/**
 * Returns a composed {@link ObjBooleanToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjBooleanToIntFunction} that first applies this function 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
 * int}./*from   w ww  .  ja v  a2s  .c o m*/
 */
@Nonnull
default ObjBooleanToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjByteToDoubleFunction.java

/**
 * Returns a composed {@link ObjByteToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjByteToIntFunction} that first applies this function 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
 * int}.//w ww .ja  v  a2 s . c o  m
 */
@Nonnull
default ObjByteToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjCharToDoubleFunction.java

/**
 * Returns a composed {@link ObjCharToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjCharToIntFunction} that first applies this function 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
 * int}./* w  ww . ja  v  a 2 s .c o m*/
 */
@Nonnull
default ObjCharToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjFloatToDoubleFunction.java

/**
 * Returns a composed {@link ObjFloatToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjFloatToIntFunction} that first applies this function 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
 * int}.//  w w w . ja  v  a  2 s.c  o  m
 */
@Nonnull
default ObjFloatToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjShortToDoubleFunction.java

/**
 * Returns a composed {@link ObjShortToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjShortToIntFunction} that first applies this function 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
 * int}./*from   ww  w.  j  a v a  2s .  c  o  m*/
 */
@Nonnull
default ObjShortToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjIntToDoubleFunction.java

/**
 * Returns a composed {@link ObjIntToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjIntToIntFunction} that first applies this function 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
 * int}./*w ww  .  j  av a2 s. c  om*/
 */
@Nonnull
default ObjIntToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToDoubleFunction.java

/**
 * Returns a composed {@link ObjLongToIntFunction} that first applies this function 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 function to an operation returning {@code int}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code ObjLongToIntFunction} that first applies this function 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
 * int}.//from  w w w. j a v a 2  s .c  o  m
 */
@Nonnull
default ObjLongToIntFunction<T> andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsDouble(t, value));
}

From source file:at.gridtec.lambda4j.operator.binary.DoubleBinaryOperator2.java

/**
 * Returns a composed {@link BiDoubleToIntFunction} that first applies this operator 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 operator to an operation returning {@code int}.
 *
 * @param after The function to apply after this operator is applied
 * @return A composed {@code BiDoubleToIntFunction} that first applies this operator 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
 * int}./* w w w . j av  a  2s . co m*/
 */
@Nonnull
default BiDoubleToIntFunction andThenToInt(@Nonnull final DoubleToIntFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsInt(applyAsDouble(value1, value2));
}