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

binary.checked.LongObjToCharE Maven / Gradle / Ivy

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

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

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

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

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

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

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

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

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