All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.mintern.functions.ternary.checked.DblObjLongToLongE Maven / Gradle / Ivy

The newest version!
package net.mintern.functions.ternary.checked;

/**
 * An operation of type {@code (double, U, long) -> long}.
 *
 * @param  the type of argument 2
 * @param  the {@code Exception} type that the operation may throw
 */
@FunctionalInterface
public interface DblObjLongToLongE {

    /**
     * Performs this operation.
     *
     * @param d argument 1
     * @param u argument 2
     * @param l argument 3
     * @return the result of the operation
     * @throws E if the operation cannot be completed
     */
    long call(double d, U u, long l) throws E;

    /**
     * Binds {@code (d)} to the beginning of {@code f}, returning a new function
     * of type {@code (U, long) -> long}.
     *
     * @param  the type of argument 2
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param d argument 1
     * @return a new function {@code (U u, long l) -> long} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.ObjLongToLongE
    bind(DblObjLongToLongE f, double d) {
        return (u, l) -> f.call(d, u, l);
    }

    /**
     * Binds {@code (d)} to the beginning of {@code this}, returning a new function
     * of type {@code (U, long) -> long}.
     *
     * @param d argument 1
     * @return a new function {@code (U u, long l) -> long} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.binary.checked.ObjLongToLongE bind(double d) {
        return DblObjLongToLongE.bind(this, d);
    }

    /**
     * Binds {@code (u, l)} to the end of {@code f}, returning a new function
     * of type {@code (double) -> long}.
     *
     * @param  the type of argument 2
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param u argument 2
     * @param l argument 3
     * @return a new function {@code (double d) -> long} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.DblToLongE
    rbind(DblObjLongToLongE f, U u, long l) {
        return (d) -> f.call(d, u, l);
    }

    /**
     * Binds {@code (u, l)} to the end of {@code this}, returning a new function
     * of type {@code (double) -> long}.
     *
     * @param u argument 2
     * @param l argument 3
     * @return a new function {@code (double d) -> long} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.unary.checked.DblToLongE rbind(U u, long l) {
        return DblObjLongToLongE.rbind(this, u, l);
    }

    /**
     * Binds {@code (d, u)} to the beginning of {@code f}, returning a new function
     * of type {@code (long) -> long}.
     *
     * @param  the type of argument 2
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param d argument 1
     * @param u argument 2
     * @return a new function {@code (long l) -> long} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.LongToLongE
    bind(DblObjLongToLongE f, double d, U u) {
        return (l) -> f.call(d, u, l);
    }

    /**
     * Binds {@code (d, u)} to the beginning of {@code this}, returning a new function
     * of type {@code (long) -> long}.
     *
     * @param d argument 1
     * @param u argument 2
     * @return a new function {@code (long l) -> long} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.unary.checked.LongToLongE bind(double d, U u) {
        return DblObjLongToLongE.bind(this, d, u);
    }

    /**
     * Binds {@code (l)} to the end of {@code f}, returning a new function
     * of type {@code (double, U) -> long}.
     *
     * @param  the type of argument 2
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param l argument 3
     * @return a new function {@code (double d, U u) -> long} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.DblObjToLongE
    rbind(DblObjLongToLongE f, long l) {
        return (d, u) -> f.call(d, u, l);
    }

    /**
     * Binds {@code (l)} to the end of {@code this}, returning a new function
     * of type {@code (double, U) -> long}.
     *
     * @param l argument 3
     * @return a new function {@code (double d, U u) -> long} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.binary.checked.DblObjToLongE rbind(long l) {
        return DblObjLongToLongE.rbind(this, l);
    }

    /**
     * Binds {@code (d, u, l)} to {@code f}, returning a new function
     * of type {@code () -> long}.
     *
     * @param  the type of argument 2
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param d argument 1
     * @param u argument 2
     * @param l argument 3
     * @return a new function {@code () -> long} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.nullary.checked.NilToLongE
    bind(DblObjLongToLongE f, double d, U u, long l) {
        return () -> f.call(d, u, l);
    }

    /**
     * Binds {@code (d, u, l)} to {@code this}, returning a new function
     * of type {@code () -> long}.
     *
     * @param d argument 1
     * @param u argument 2
     * @param l argument 3
     * @return a new function {@code () -> long} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.nullary.checked.NilToLongE bind(double d, U u, long l) {
        return DblObjLongToLongE.bind(this, d, u, l);
    }
}