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

binary.checked.LongCharToByteE 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, char) -> byte}.
 *
 * @param  the {@code Exception} type that the operation may throw
 */
@FunctionalInterface
public interface LongCharToByteE {

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

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

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

    /**
     * Binds {@code (ch)} to the end of {@code f}, returning a new function
     * of type {@code (long) -> byte}.
     *
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param ch argument 2
     * @return a new function {@code (long l) -> byte} that calls
     *      {@code f.call(l, ch)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.LongToByteE
    rbind(LongCharToByteE f, char ch) {
        return (l) -> f.call(l, ch);
    }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy