Example usage for java.util.function IntToLongFunction applyAsLong

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

Introduction

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

Prototype

long applyAsLong(int value);

Source Link

Document

Applies this function to the given argument.

Usage

From source file:Main.java

public static void main(String[] args) {
    IntToLongFunction i = (x) -> Long.MAX_VALUE - x;
    System.out.println(i.applyAsLong(2));
}

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

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

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

/**
 * Creates a {@link BiIntToLongFunction} which uses the {@code second} parameter of this one as argument for the
 * given {@link IntToLongFunction}./*from  w w w .j  a v  a  2 s  .co  m*/
 *
 * @param function The function which accepts the {@code second} parameter of this one
 * @return Creates a {@code BiIntToLongFunction} which uses the {@code second} parameter of this one as argument for
 * the given {@code IntToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static BiIntToLongFunction onlySecond(@Nonnull final IntToLongFunction function) {
    Objects.requireNonNull(function);
    return (value1, value2) -> function.applyAsLong(value2);
}

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

/**
 * Creates a {@link ObjIntToLongFunction} which uses the {@code second} parameter of this one as argument for the
 * given {@link IntToLongFunction}./*from  www .j a  v  a  2s . c  o 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 ObjIntToLongFunction} which uses the {@code second} parameter of this one as argument
 * for the given {@code IntToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjIntToLongFunction<T> onlySecond(@Nonnull final IntToLongFunction function) {
    Objects.requireNonNull(function);
    return (t, value) -> function.applyAsLong(value);
}

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

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

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

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

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

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

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

/**
 * Creates a {@link ObjBiIntToLongFunction} which uses the {@code second} parameter of this one as argument for the
 * given {@link IntToLongFunction}.//from w ww.j a  v  a2 s .  c  om
 *
 * @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 ObjBiIntToLongFunction} which uses the {@code second} parameter of this one as argument
 * for the given {@code IntToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiIntToLongFunction<T> onlySecond(@Nonnull final IntToLongFunction function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(value1);
}

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

/**
 * Creates a {@link ObjBiIntToLongFunction} which uses the {@code third} parameter of this one as argument for the
 * given {@link IntToLongFunction}.//from  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 third} parameter of this one
 * @return Creates a {@code ObjBiIntToLongFunction} which uses the {@code third} parameter of this one as argument
 * for the given {@code IntToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T> ObjBiIntToLongFunction<T> onlyThird(@Nonnull final IntToLongFunction function) {
    Objects.requireNonNull(function);
    return (t, value1, value2) -> function.applyAsLong(value2);
}

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

/**
 * Creates a {@link BiObjIntToLongFunction} which uses the {@code third} parameter of this one as argument for the
 * given {@link IntToLongFunction}./*from   www  . ja v a2  s  .com*/
 *
 * @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 BiObjIntToLongFunction} which uses the {@code third} parameter of this one as argument
 * for the given {@code IntToLongFunction}.
 * @throws NullPointerException If given argument is {@code null}
 */
@Nonnull
static <T, U> BiObjIntToLongFunction<T, U> onlyThird(@Nonnull final IntToLongFunction function) {
    Objects.requireNonNull(function);
    return (t, u, value) -> function.applyAsLong(value);
}