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

binary.checked.DblObjToByteE Maven / Gradle / Ivy

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

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

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

    /**
     * Binds {@code (d)} to the beginning of {@code f}, returning a new function
     * of type {@code (U) -> byte}.
     *
     * @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) -> byte} that calls
     *      {@code f.call(d, u)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.ObjToByteE
    bind(DblObjToByteE f, double d) {
        return (u) -> f.call(d, u);
    }

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

    /**
     * Binds {@code (u)} to the end of {@code f}, returning a new function
     * of type {@code (double) -> byte}.
     *
     * @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
     * @return a new function {@code (double d) -> byte} that calls
     *      {@code f.call(d, u)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.DblToByteE
    rbind(DblObjToByteE f, U u) {
        return (d) -> f.call(d, u);
    }

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

    /**
     * Binds {@code (d, u)} to {@code f}, returning a new function
     * of type {@code () -> byte}.
     *
     * @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 () -> byte} that calls
     *      {@code f.call(d, u)} and returns the result.
     */
    static  net.mintern.functions.nullary.checked.NilToByteE
    bind(DblObjToByteE f, double d, U u) {
        return () -> f.call(d, u);
    }

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