Example usage for java.util.function LongToDoubleFunction applyAsDouble

List of usage examples for java.util.function LongToDoubleFunction applyAsDouble

Introduction

In this page you can find the example usage for java.util.function LongToDoubleFunction applyAsDouble.

Prototype

double applyAsDouble(long value);

Source Link

Document

Applies this function to the given argument.

Usage

From source file:Main.java

public static void main(String[] args) {
    LongToDoubleFunction i = (l) -> Math.sin(l);

    System.out.println(i.applyAsDouble(Long.MAX_VALUE));
}

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

/**
 * Creates a {@link BiLongToDoubleFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link LongToDoubleFunction}./*from w ww. jav a 2 s. c  om*/
 *
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code BiLongToDoubleFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static BiLongToDoubleFunction onlyFirst(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (value1, value2) -> function.applyAsDouble(value1);
}

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

/**
 * Creates a {@link BiLongToDoubleFunction} which uses the {@code second} parameter of this one as argument for the
 * given {@link LongToDoubleFunction}./*  w  w  w  .  ja  va 2  s .  c  o m*/
 *
 * @param function The function which accepts the {@code second} parameter of this one
 * @return Creates a {@code BiLongToDoubleFunction} which uses the {@code second} parameter of this one as argument
 * for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static BiLongToDoubleFunction onlySecond(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (value1, value2) -> function.applyAsDouble(value2);
}

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

/**
 * Creates a {@link ObjLongToDoubleFunction} which uses the {@code second} parameter of this one as argument for the
 * given {@link LongToDoubleFunction}.//  w  w w  . j  av a 2  s . co  m
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code second} parameter of this one
 * @return Creates a {@code ObjLongToDoubleFunction} which uses the {@code second} parameter of this one as argument
 * for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjLongToDoubleFunction<T> onlySecond(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (t, value) -> function.applyAsDouble(value);
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriLongToDoubleFunction.java

/**
 * Creates a {@link TriLongToDoubleFunction} which uses the {@code first} parameter of this one as argument for the
 * given {@link LongToDoubleFunction}./*from w  ww  .  j a  va  2  s. c  o m*/
 *
 * @param function The function which accepts the {@code first} parameter of this one
 * @return Creates a {@code TriLongToDoubleFunction} which uses the {@code first} parameter of this one as argument
 * for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static TriLongToDoubleFunction onlyFirst(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (value1, value2, value3) -> function.applyAsDouble(value1);
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriLongToDoubleFunction.java

/**
 * Creates a {@link TriLongToDoubleFunction} which uses the {@code second} parameter of this one as argument for the
 * given {@link LongToDoubleFunction}./*from w w w  .ja va2  s  .c  om*/
 *
 * @param function The function which accepts the {@code second} parameter of this one
 * @return Creates a {@code TriLongToDoubleFunction} which uses the {@code second} parameter of this one as argument
 * for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static TriLongToDoubleFunction onlySecond(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (value1, value2, value3) -> function.applyAsDouble(value2);
}

From source file:at.gridtec.lambda4j.function.tri.conversion.TriLongToDoubleFunction.java

/**
 * Creates a {@link TriLongToDoubleFunction} which uses the {@code third} parameter of this one as argument for the
 * given {@link LongToDoubleFunction}.//from  w w  w  .  j  a  v  a2 s  .  c  o m
 *
 * @param function The function which accepts the {@code third} parameter of this one
 * @return Creates a {@code TriLongToDoubleFunction} which uses the {@code third} parameter of this one as argument
 * for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static TriLongToDoubleFunction onlyThird(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (value1, value2, value3) -> function.applyAsDouble(value3);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiLongToDoubleFunction.java

/**
 * Creates a {@link ObjBiLongToDoubleFunction} which uses the {@code second} parameter of this one as argument for
 * the given {@link LongToDoubleFunction}.
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code second} parameter of this one
 * @return Creates a {@code ObjBiLongToDoubleFunction} which uses the {@code second} parameter of this one as
 * argument for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */// w w  w  .  j a va2  s .  c o  m
@Nonnull
static <T> ObjBiLongToDoubleFunction<T> onlySecond(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsDouble(value1);
}

From source file:at.gridtec.lambda4j.function.tri.obj.ObjBiLongToDoubleFunction.java

/**
 * Creates a {@link ObjBiLongToDoubleFunction} which uses the {@code third} parameter of this one as argument for
 * the given {@link LongToDoubleFunction}.
 *
 * @param <T> The type of the first argument to the function
 * @param function The function which accepts the {@code third} parameter of this one
 * @return Creates a {@code ObjBiLongToDoubleFunction} which uses the {@code third} parameter of this one as
 * argument for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 *//*  w  w  w.  j  ava 2  s. c o m*/
@Nonnull
static <T> ObjBiLongToDoubleFunction<T> onlyThird(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsDouble(value2);
}

From source file:at.gridtec.lambda4j.function.tri.obj.BiObjLongToDoubleFunction.java

/**
 * Creates a {@link BiObjLongToDoubleFunction} which uses the {@code third} parameter of this one as argument for
 * the given {@link LongToDoubleFunction}.
 *
 * @param <T> The type of the first argument to the function
 * @param <U> The type of the second argument to the function
 * @param function The function which accepts the {@code third} parameter of this one
 * @return Creates a {@code BiObjLongToDoubleFunction} which uses the {@code third} parameter of this one as
 * argument for the given {@code LongToDoubleFunction}.
 * @throws NullPointerException If given argument is {@code null}
 *//*  w  w  w . ja va 2  s  . c o  m*/
@Nonnull
static <T, U> BiObjLongToDoubleFunction<T, U> onlyThird(@Nonnull final LongToDoubleFunction function) {
    Objects.requireNonNull(function);
    return (t, u, value) -> function.applyAsDouble(value);
}