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

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

There is a newer version: 2.0
Show newest version
package net.mintern.functions.ternary.checked;

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

    /**
     * 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
     */
    R 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) -> R}.
     *
     * @param  the type of argument 2
     * @param  the type of the return value
     * @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) -> R} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.ObjLongToObjE
    bind(DblObjLongToObjE 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) -> R}.
     *
     * @param d argument 1
     * @return a new function {@code (U u, long l) -> R} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.binary.checked.ObjLongToObjE bind(double d) {
        return DblObjLongToObjE.bind(this, d);
    }

    /**
     * Binds {@code (u, l)} to the end of {@code f}, returning a new function
     * of type {@code (double) -> R}.
     *
     * @param  the type of argument 2
     * @param  the type of the return value
     * @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) -> R} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.DblToObjE
    rbind(DblObjLongToObjE 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) -> R}.
     *
     * @param u argument 2
     * @param l argument 3
     * @return a new function {@code (double d) -> R} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.unary.checked.DblToObjE rbind(U u, long l) {
        return DblObjLongToObjE.rbind(this, u, l);
    }

    /**
     * Binds {@code (d, u)} to the beginning of {@code f}, returning a new function
     * of type {@code (long) -> R}.
     *
     * @param  the type of argument 2
     * @param  the type of the return value
     * @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) -> R} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.LongToObjE
    bind(DblObjLongToObjE 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) -> R}.
     *
     * @param d argument 1
     * @param u argument 2
     * @return a new function {@code (long l) -> R} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.unary.checked.LongToObjE bind(double d, U u) {
        return DblObjLongToObjE.bind(this, d, u);
    }

    /**
     * Binds {@code (l)} to the end of {@code f}, returning a new function
     * of type {@code (double, U) -> R}.
     *
     * @param  the type of argument 2
     * @param  the type of the return value
     * @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) -> R} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.DblObjToObjE
    rbind(DblObjLongToObjE 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) -> R}.
     *
     * @param l argument 3
     * @return a new function {@code (double d, U u) -> R} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.binary.checked.DblObjToObjE rbind(long l) {
        return DblObjLongToObjE.rbind(this, l);
    }

    /**
     * Binds {@code (d, u, l)} to {@code f}, returning a new function
     * of type {@code () -> R}.
     *
     * @param  the type of argument 2
     * @param  the type of the return value
     * @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 () -> R} that calls
     *      {@code f.call(d, u, l)} and returns the result.
     */
    @SuppressWarnings("unchecked") // maven spuriously warns about a type error in this case
    static  net.mintern.functions.nullary.checked.NilToObjE
    bind(DblObjLongToObjE 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 () -> R}.
     *
     * @param d argument 1
     * @param u argument 2
     * @param l argument 3
     * @return a new function {@code () -> R} that calls
     *      {@code this.call(d, u, l)} and returns the result.
     */
    default net.mintern.functions.nullary.checked.NilToObjE bind(double d, U u, long l) {
        return DblObjLongToObjE.bind(this, d, u, l);
    }
}