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

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

    /**
     * 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
     */
    float call(char ch1, char ch2) throws E;

    /**
     * Binds {@code (ch1)} to the beginning of {@code f}, returning a new function
     * of type {@code (char) -> float}.
     *
     * @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) -> float} that calls
     *      {@code f.call(ch1, ch2)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.CharToFloatE
    bind(CharCharToFloatE 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) -> float}.
     *
     * @param ch1 argument 1
     * @return a new function {@code (char ch2) -> float} that calls
     *      {@code this.call(ch1, ch2)} and returns the result.
     */
    default net.mintern.functions.unary.checked.CharToFloatE bind(char ch1) {
        return CharCharToFloatE.bind(this, ch1);
    }

    /**
     * Binds {@code (ch2)} to the end of {@code f}, returning a new function
     * of type {@code (char) -> float}.
     *
     * @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) -> float} that calls
     *      {@code f.call(ch1, ch2)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.CharToFloatE
    rbind(CharCharToFloatE 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) -> float}.
     *
     * @param ch2 argument 2
     * @return a new function {@code (char ch1) -> float} that calls
     *      {@code this.call(ch1, ch2)} and returns the result.
     */
    default net.mintern.functions.unary.checked.CharToFloatE rbind(char ch2) {
        return CharCharToFloatE.rbind(this, ch2);
    }

    /**
     * Binds {@code (ch1, ch2)} to {@code f}, returning a new function
     * of type {@code () -> float}.
     *
     * @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 () -> float} that calls
     *      {@code f.call(ch1, ch2)} and returns the result.
     */
    static  net.mintern.functions.nullary.checked.NilToFloatE
    bind(CharCharToFloatE f, char ch1, char ch2) {
        return () -> f.call(ch1, ch2);
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy