Example usage for java.util.function LongUnaryOperator applyAsLong

List of usage examples for java.util.function LongUnaryOperator applyAsLong

Introduction

In this page you can find the example usage for java.util.function LongUnaryOperator applyAsLong.

Prototype

long applyAsLong(long operand);

Source Link

Document

Applies this operator to the given operand.

Usage

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

/**
 * Returns a composed {@link BiLongToIntFunction} that first applies the {@code before} operators 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 operator to apply before this function is applied
 * @param before2 The second operator to apply before this function is applied
 * @return A composed {@code BiLongToIntFunction} that first applies the {@code before} operators 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  .j  a  v a2  s .co m*/
 */
@Nonnull
default BiLongToIntFunction composeFromLong(@Nonnull final LongUnaryOperator before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsInt(before1.applyAsLong(value1), before2.applyAsLong(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToByteFunction.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 operator 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  w  w  .  ja  v  a  2 s . c o m*/
 */
@Nonnull
default BiLongToByteFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsByte(before1.apply(value1), before2.applyAsLong(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToCharFunction.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 operator 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}./* www . ja  v a  2s .com*/
 */
@Nonnull
default BiLongToCharFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsChar(before1.apply(value1), before2.applyAsLong(value2));
}

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

/**
 * Returns a composed {@link LongBinaryOperator2} 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 operator to apply before this function is applied
 * @return A composed {@code LongBinaryOperator2} 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  va  2 s  .  c  o m
 */
@Nonnull
default LongBinaryOperator2 composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsLong(before1.apply(value1), before2.applyAsLong(value2));
}

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

/**
 * Returns a composed {@link BiLongToFloatFunction} that first applies the {@code before} operators 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 operator to apply before this function is applied
 * @param before2 The second operator to apply before this function is applied
 * @return A composed {@code BiLongToFloatFunction} that first applies the {@code before} operators 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}.//ww w . j av  a  2 s. com
 */
@Nonnull
default BiLongToFloatFunction composeFromLong(@Nonnull final LongUnaryOperator before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.applyAsLong(value1), before2.applyAsLong(value2));
}

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

/**
 * Returns a composed {@link BiLongToShortFunction} that first applies the {@code before} operators 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 operator to apply before this function is applied
 * @param before2 The second operator to apply before this function is applied
 * @return A composed {@code BiLongToShortFunction} that first applies the {@code before} operators 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 .ja  v a2  s.c om*/
 */
@Nonnull
default BiLongToShortFunction composeFromLong(@Nonnull final LongUnaryOperator before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsShort(before1.applyAsLong(value1), before2.applyAsLong(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToFloatFunction.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 operator 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  . ja v  a2  s. c o  m
 */
@Nonnull
default BiLongToFloatFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsFloat(before1.apply(value1), before2.applyAsLong(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToIntFunction.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 operator 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 .ja v a 2s . co  m*/
 */
@Nonnull
default BiLongToIntFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsInt(before1.apply(value1), before2.applyAsLong(value2));
}

From source file:at.gridtec.lambda4j.function.bi.obj.ObjLongToShortFunction.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 operator 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}.//w ww. ja  va 2 s  .  co  m
 */
@Nonnull
default BiLongToShortFunction composeFromLong(@Nonnull final LongFunction<? extends T> before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsShort(before1.apply(value1), before2.applyAsLong(value2));
}

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

/**
 * Returns a composed {@link BiLongToDoubleFunction} that first applies the {@code before} operators 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 operator to apply before this function is applied
 * @param before2 The second operator to apply before this function is applied
 * @return A composed {@code BiLongToDoubleFunction} that first applies the {@code before} operators 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  ava  2  s  .  c o  m*/
 */
@Nonnull
default BiLongToDoubleFunction composeFromLong(@Nonnull final LongUnaryOperator before1,
        @Nonnull final LongUnaryOperator before2) {
    Objects.requireNonNull(before1);
    Objects.requireNonNull(before2);
    return (value1, value2) -> applyAsDouble(before1.applyAsLong(value1), before2.applyAsLong(value2));
}