Example usage for java.util.function LongToIntFunction applyAsInt

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

Introduction

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

Prototype

int applyAsInt(long value);

Source Link

Document

Applies this function to the given argument.

Usage

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

/**
 * Returns a composed {@link BiDoubleToIntFunction} 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 BiDoubleToIntFunction} 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 va  2 s .  c  o m*/
 */
@Nonnull
default BiDoubleToIntFunction andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsInt(applyAsLong(value1, value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToLongFunction.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}.//w ww.j  a va 2s .  c  om
 */
@Nonnull
default ObjLongToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjByteToLongFunction.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 .  j av a2 s . co  m*/
 */
@Nonnull
default ObjByteToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjCharToLongFunction.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}./*from w  w  w .jav  a 2s . c om*/
 */
@Nonnull
default ObjCharToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjFloatToLongFunction.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}.// ww w . jav  a2 s. c  om
 */
@Nonnull
default ObjFloatToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjShortToLongFunction.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  w ww .  j a v a2 s.c  om
 */
@Nonnull
default ObjShortToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjBooleanToLongFunction.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  . j a  v  a  2s  .  c  o  m*/
 */
@Nonnull
default ObjBooleanToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjIntToLongFunction.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 w  w.  j  a  va 2 s  . com*/
 */
@Nonnull
default ObjIntToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjDoubleToLongFunction.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}./*from   w  w w  .j  av  a  2  s  .c  o m*/
 */
@Nonnull
default ObjDoubleToIntFunction<T> andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsInt(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link BiLongToIntFunction} 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 BiLongToIntFunction} 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}./*from w w w  .ja  v a  2s . co m*/
 */
@Nonnull
default BiLongToIntFunction andThenToInt(@Nonnull final LongToIntFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsInt(applyAsLong(value1, value2));
}