Example usage for java.util.function DoubleToLongFunction applyAsLong

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

Introduction

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

Prototype

long applyAsLong(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 LongBinaryOperator2} 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 long}.
 *
 * @param after The function to apply after this function is applied
 * @return A composed {@code LongBinaryOperator2} 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
 * long}./*  w w  w .  jav  a2s.  com*/
 */
@Nonnull
default LongBinaryOperator2 andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (value1, value2) -> after.applyAsLong(applyAsDouble(value1, value2));
}

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

/**
 * Returns a composed {@link ObjDoubleToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}.//from   w ww.  ja v  a2 s  .c o  m
 */
@Nonnull
default ObjDoubleToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

/**
 * Returns a composed {@link ObjBooleanToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}./*from w  ww. j av a 2  s .c o  m*/
 */
@Nonnull
default ObjBooleanToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

/**
 * Returns a composed {@link ObjByteToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}.//from w  w  w. ja va2  s.com
 */
@Nonnull
default ObjByteToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

/**
 * Returns a composed {@link ObjCharToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}.//from   ww w .j a v a 2s  .c o  m
 */
@Nonnull
default ObjCharToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

/**
 * Returns a composed {@link ObjFloatToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}.//from ww  w . j a  va  2 s  .  c  om
 */
@Nonnull
default ObjFloatToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

/**
 * Returns a composed {@link ObjShortToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}./* w w  w  . j a va 2  s  .c  om*/
 */
@Nonnull
default ObjShortToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

/**
 * Returns a composed {@link ObjIntToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}.//from  ww w  . ja  v a  2s . co  m
 */
@Nonnull
default ObjIntToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

/**
 * Returns a composed {@link ObjLongToLongFunction} 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 long}.
 *
 * @param after The function 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} 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
 * long}.//ww w .ja  va 2 s. c  om
 */
@Nonnull
default ObjLongToLongFunction<T> andThenToLong(@Nonnull final DoubleToLongFunction after) {
    Objects.requireNonNull(after);
    return (t, value) -> after.applyAsLong(applyAsDouble(t, value));
}

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

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