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

binary.checked.CharCharToByteE Maven / Gradle / Ivy

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

/**
 * An operation of type {@code (char, char) -> byte}.
 *
 * @param  the {@code Exception} type that the operation may throw
 */
@FunctionalInterface
public interface CharCharToByteE {

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

    /**
     * Binds {@code (ch1)} 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 ch1 argument 1
     * @return a new function {@code (char ch2) -> byte} that calls
     *      {@code f.call(ch1, ch2)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.CharToByteE
    bind(CharCharToByteE f, char ch1) {
        return (ch2) -> f.call(ch1, ch2);
    }

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

    /**
     * Binds {@code (ch2)} to the end 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 ch2 argument 2
     * @return a new function {@code (char ch1) -> byte} that calls
     *      {@code f.call(ch1, ch2)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.CharToByteE
    rbind(CharCharToByteE f, char ch2) {
        return (ch1) -> f.call(ch1, ch2);
    }

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

    /**
     * Binds {@code (ch1, ch2)} 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 ch1 argument 1
     * @param ch2 argument 2
     * @return a new function {@code () -> byte} that calls
     *      {@code f.call(ch1, ch2)} and returns the result.
     */
    static  net.mintern.functions.nullary.checked.NilToByteE
    bind(CharCharToByteE f, char ch1, char ch2) {
        return () -> f.call(ch1, ch2);
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy