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

ternary.checked.ObjIntDblToObjE Maven / Gradle / Ivy

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

/**
 * An operation of type {@code (T, int, double) -> R}.
 *
 * @param  the type of argument 1
 * @param  the type of the return value
 * @param  the {@code Exception} type that the operation may throw
 */
@FunctionalInterface
public interface ObjIntDblToObjE {

    /**
     * Performs this operation.
     *
     * @param t argument 1
     * @param i argument 2
     * @param d argument 3
     * @return the result of the operation
     * @throws E if the operation cannot be completed
     */
    R call(T t, int i, double d) throws E;

    /**
     * Binds {@code (t)} to the beginning of {@code f}, returning a new function
     * of type {@code (int, double) -> R}.
     *
     * @param  the type of argument 1
     * @param  the type of the return value
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param t argument 1
     * @return a new function {@code (int i, double d) -> R} that calls
     *      {@code f.call(t, i, d)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.IntDblToObjE
    bind(ObjIntDblToObjE f, T t) {
        return (i, d) -> f.call(t, i, d);
    }

    /**
     * Binds {@code (t)} to the beginning of {@code this}, returning a new function
     * of type {@code (int, double) -> R}.
     *
     * @param t argument 1
     * @return a new function {@code (int i, double d) -> R} that calls
     *      {@code this.call(t, i, d)} and returns the result.
     */
    default net.mintern.functions.binary.checked.IntDblToObjE bind(T t) {
        return ObjIntDblToObjE.bind(this, t);
    }

    /**
     * Binds {@code (i, d)} to the end of {@code f}, returning a new function
     * of type {@code (T) -> R}.
     *
     * @param  the type of argument 1
     * @param  the type of the return value
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param i argument 2
     * @param d argument 3
     * @return a new function {@code (T t) -> R} that calls
     *      {@code f.call(t, i, d)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.ObjToObjE
    rbind(ObjIntDblToObjE f, int i, double d) {
        return (t) -> f.call(t, i, d);
    }

    /**
     * Binds {@code (i, d)} to the end of {@code this}, returning a new function
     * of type {@code (T) -> R}.
     *
     * @param i argument 2
     * @param d argument 3
     * @return a new function {@code (T t) -> R} that calls
     *      {@code this.call(t, i, d)} and returns the result.
     */
    default net.mintern.functions.unary.checked.ObjToObjE rbind(int i, double d) {
        return ObjIntDblToObjE.rbind(this, i, d);
    }

    /**
     * Binds {@code (t, i)} to the beginning of {@code f}, returning a new function
     * of type {@code (double) -> R}.
     *
     * @param  the type of argument 1
     * @param  the type of the return value
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param t argument 1
     * @param i argument 2
     * @return a new function {@code (double d) -> R} that calls
     *      {@code f.call(t, i, d)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.DblToObjE
    bind(ObjIntDblToObjE f, T t, int i) {
        return (d) -> f.call(t, i, d);
    }

    /**
     * Binds {@code (t, i)} to the beginning of {@code this}, returning a new function
     * of type {@code (double) -> R}.
     *
     * @param t argument 1
     * @param i argument 2
     * @return a new function {@code (double d) -> R} that calls
     *      {@code this.call(t, i, d)} and returns the result.
     */
    default net.mintern.functions.unary.checked.DblToObjE bind(T t, int i) {
        return ObjIntDblToObjE.bind(this, t, i);
    }

    /**
     * Binds {@code (d)} to the end of {@code f}, returning a new function
     * of type {@code (T, int) -> R}.
     *
     * @param  the type of argument 1
     * @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 3
     * @return a new function {@code (T t, int i) -> R} that calls
     *      {@code f.call(t, i, d)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.ObjIntToObjE
    rbind(ObjIntDblToObjE f, double d) {
        return (t, i) -> f.call(t, i, d);
    }

    /**
     * Binds {@code (d)} to the end of {@code this}, returning a new function
     * of type {@code (T, int) -> R}.
     *
     * @param d argument 3
     * @return a new function {@code (T t, int i) -> R} that calls
     *      {@code this.call(t, i, d)} and returns the result.
     */
    default net.mintern.functions.binary.checked.ObjIntToObjE rbind(double d) {
        return ObjIntDblToObjE.rbind(this, d);
    }

    /**
     * Binds {@code (t, i, d)} to {@code f}, returning a new function
     * of type {@code () -> R}.
     *
     * @param  the type of argument 1
     * @param  the type of the return value
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param t argument 1
     * @param i argument 2
     * @param d argument 3
     * @return a new function {@code () -> R} that calls
     *      {@code f.call(t, i, d)} and returns the result.
     */
    @SuppressWarnings("unchecked") // maven spuriously warns about a type error in this case
    static  net.mintern.functions.nullary.checked.NilToObjE
    bind(ObjIntDblToObjE f, T t, int i, double d) {
        return () -> f.call(t, i, d);
    }

    /**
     * Binds {@code (t, i, d)} to {@code this}, returning a new function
     * of type {@code () -> R}.
     *
     * @param t argument 1
     * @param i argument 2
     * @param d argument 3
     * @return a new function {@code () -> R} that calls
     *      {@code this.call(t, i, d)} and returns the result.
     */
    default net.mintern.functions.nullary.checked.NilToObjE bind(T t, int i, double d) {
        return ObjIntDblToObjE.bind(this, t, i, d);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy