Example usage for java.util.function LongFunction apply

List of usage examples for java.util.function LongFunction apply

Introduction

In this page you can find the example usage for java.util.function LongFunction apply.

Prototype

R apply(long value);

Source Link

Document

Applies this function to the given argument.

Usage

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

/**
 * Returns a composed {@link BiLongToByteFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToByteFunction} 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
 * long}.//from w  ww .j a  v  a 2s  .  c o  m
 */
@Nonnull
default BiLongToByteFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToDoubleFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsByte(before1.apply(value1), before2.applyAsDouble(value2));
}

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

/**
 * Returns a composed {@link BiLongToCharFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToCharFunction} 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
 * long}./*from  w w w.  j  ava2s . co  m*/
 */
@Nonnull
default BiLongToCharFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToDoubleFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsChar(before1.apply(value1), before2.applyAsDouble(value2));
}

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

/**
 * Returns a composed {@link BiLongToShortFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToShortFunction} 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
 * long}./*from w  w w.j  a  v a2 s.  c  om*/
 */
@Nonnull
default BiLongToShortFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToFloatFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsShort(before1.apply(value1), before2.applyAsFloat(value2));
}

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

/**
 * Returns a composed {@link BiLongToFloatFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToFloatFunction} 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
 * long}./*from ww  w.  jav a 2  s. c  om*/
 */
@Nonnull
default BiLongToFloatFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToShortFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsShort(value2));
}

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

/**
 * Returns a composed {@link BiLongToDoubleFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToDoubleFunction} 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
 * long}./* w ww.  j a  v a 2  s  .  co  m*/
 */
@Nonnull
default BiLongToDoubleFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToByteFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsByte(value2));
}

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

/**
 * Returns a composed {@link BiLongToDoubleFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToDoubleFunction} 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
 * long}.//from w w w .j a v  a2  s  .co m
 */
@Nonnull
default BiLongToDoubleFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToCharFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsChar(value2));
}

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

/**
 * Returns a composed {@link BiLongToFloatFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToFloatFunction} 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
 * long}.//from  w w w .ja va  2s . c o  m
 */
@Nonnull
default BiLongToFloatFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToDoubleFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsDouble(value2));
}

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

/**
 * Returns a composed {@link BiLongToIntFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToIntFunction} 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
 * long}./*from  w w w  .j  a  va 2 s. com*/
 */
@Nonnull
default BiLongToIntFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToDoubleFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsInt(before1.apply(value1), before2.applyAsDouble(value2));
}

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

/**
 * Returns a composed {@link BiLongToShortFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToShortFunction} 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
 * long}.//from   www . ja  va 2  s .co m
 */
@Nonnull
default BiLongToShortFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToDoubleFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsShort(before1.apply(value1), before2.applyAsDouble(value2));
}

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

/**
 * Returns a composed {@link BiLongToDoubleFunction} 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 long} input,
 * before this primitive function is executed.
 *
 * @param before1 The first function to apply before this function is applied
 * @param before2 The second function to apply before this function is applied
 * @return A composed {@code BiLongToDoubleFunction} 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
 * long}.//from   w w  w.j  a  v a2  s.  c  o m
 */
@Nonnull
default BiLongToDoubleFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongToIntFunction before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.apply(value1), before2.applyAsInt(value2));
}