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.BiIntToLongFunction.java

/**
 * Returns a composed {@link BiIntToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code BiIntToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}.//  w  w w.j a  va 2 s  .  com
 */
@Nonnull
default BiIntToLongFunction andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsLong(applyAsLong(value1, value2));
}

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

/**
 * Returns a composed {@link BiDoubleToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code BiDoubleToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}./*from   www  . j a v a 2s.c  o m*/
 */
@Nonnull
default BiDoubleToLongFunction andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsLong(applyAsLong(value1, value2));
}

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

/**
 * Returns a composed {@link ObjLongToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjLongToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}.//from   w w w .j  a  v a2s .co m
 */
@Nonnull
default ObjLongToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link ObjByteToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjByteToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}./*from  ww w .j ava2 s  .co  m*/
 */
@Nonnull
default ObjByteToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link ObjCharToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjCharToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}./*  w w w  .j a  v a2 s  .  co  m*/
 */
@Nonnull
default ObjCharToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link ObjFloatToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjFloatToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}.//w w w . jav a  2  s. c  om
 */
@Nonnull
default ObjFloatToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link ObjShortToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjShortToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}.//from w  w  w  .  j  a  va  2s.com
 */
@Nonnull
default ObjShortToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link ObjBooleanToLongFunction} that first applies this function to its input, and then
 * applies the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjBooleanToLongFunction} that first applies this function to its input, and then
 * applies the {@code after} operator 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
 * long}./*from   www  .j  a v  a  2 s.com*/
 */
@Nonnull
default ObjBooleanToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link ObjIntToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjIntToLongFunction} that first applies this function to its input, and then applies
 * the {@code after} operator 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
 * long}./*w w  w. ja  va2  s. com*/
 */
@Nonnull
default ObjIntToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}

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

/**
 * Returns a composed {@link ObjDoubleToLongFunction} that first applies this function to its input, and then
 * applies the {@code after} operator 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 long}.
 *
 * @param after The operator to apply after this function is applied
 * @return A composed {@code ObjDoubleToLongFunction} that first applies this function to its input, and then
 * applies the {@code after} operator 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
 * long}./*from   w w  w.j  av  a 2s .c  o m*/
 */
@Nonnull
default ObjDoubleToLongFunction<T> andThenToLong(@Nonnull final LongUnaryOperator after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsLong(t, value));
}