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

ternary.checked.LongObjLongToObjE Maven / Gradle / Ivy

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

/**
 * An operation of type {@code (long, 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 LongObjLongToObjE {

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

    /**
     * Binds {@code (l1)} 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 l1 argument 1
     * @return a new function {@code (U u, long l3) -> R} that calls
     *      {@code f.call(l1, u, l3)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.ObjLongToObjE
    bind(LongObjLongToObjE f, long l1) {
        return (u, l3) -> f.call(l1, u, l3);
    }

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

    /**
     * Binds {@code (u, l3)} to the end 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 u argument 2
     * @param l3 argument 3
     * @return a new function {@code (long l1) -> R} that calls
     *      {@code f.call(l1, u, l3)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.LongToObjE
    rbind(LongObjLongToObjE f, U u, long l3) {
        return (l1) -> f.call(l1, u, l3);
    }

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

    /**
     * Binds {@code (l1, 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 l1 argument 1
     * @param u argument 2
     * @return a new function {@code (long l3) -> R} that calls
     *      {@code f.call(l1, u, l3)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.LongToObjE
    bind(LongObjLongToObjE f, long l1, U u) {
        return (l3) -> f.call(l1, u, l3);
    }

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

    /**
     * Binds {@code (l3)} to the end of {@code f}, returning a new function
     * of type {@code (long, 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 l3 argument 3
     * @return a new function {@code (long l1, U u) -> R} that calls
     *      {@code f.call(l1, u, l3)} and returns the result.
     */
    static  net.mintern.functions.binary.checked.LongObjToObjE
    rbind(LongObjLongToObjE f, long l3) {
        return (l1, u) -> f.call(l1, u, l3);
    }

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

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

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