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

binary.checked.FloatFloatToObjE Maven / Gradle / Ivy

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

/**
 * An operation of type {@code (float, float) -> R}.
 *
 * @param  the type of the return value
 * @param  the {@code Exception} type that the operation may throw
 */
@FunctionalInterface
public interface FloatFloatToObjE {

    /**
     * Performs this operation.
     *
     * @param fl1 argument 1
     * @param fl2 argument 2
     * @return the result of the operation
     * @throws E if the operation cannot be completed
     */
    R call(float fl1, float fl2) throws E;

    /**
     * Binds {@code (fl1)} to the beginning of {@code f}, returning a new function
     * of type {@code (float) -> R}.
     *
     * @param  the type of the return value
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param fl1 argument 1
     * @return a new function {@code (float fl2) -> R} that calls
     *      {@code f.call(fl1, fl2)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.FloatToObjE
    bind(FloatFloatToObjE f, float fl1) {
        return (fl2) -> f.call(fl1, fl2);
    }

    /**
     * Binds {@code (fl1)} to the beginning of {@code this}, returning a new function
     * of type {@code (float) -> R}.
     *
     * @param fl1 argument 1
     * @return a new function {@code (float fl2) -> R} that calls
     *      {@code this.call(fl1, fl2)} and returns the result.
     */
    default net.mintern.functions.unary.checked.FloatToObjE bind(float fl1) {
        return FloatFloatToObjE.bind(this, fl1);
    }

    /**
     * Binds {@code (fl2)} to the end of {@code f}, returning a new function
     * of type {@code (float) -> R}.
     *
     * @param  the type of the return value
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param fl2 argument 2
     * @return a new function {@code (float fl1) -> R} that calls
     *      {@code f.call(fl1, fl2)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.FloatToObjE
    rbind(FloatFloatToObjE f, float fl2) {
        return (fl1) -> f.call(fl1, fl2);
    }

    /**
     * Binds {@code (fl2)} to the end of {@code this}, returning a new function
     * of type {@code (float) -> R}.
     *
     * @param fl2 argument 2
     * @return a new function {@code (float fl1) -> R} that calls
     *      {@code this.call(fl1, fl2)} and returns the result.
     */
    default net.mintern.functions.unary.checked.FloatToObjE rbind(float fl2) {
        return FloatFloatToObjE.rbind(this, fl2);
    }

    /**
     * Binds {@code (fl1, fl2)} to {@code f}, returning a new function
     * of type {@code () -> R}.
     *
     * @param  the type of the return value
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param fl1 argument 1
     * @param fl2 argument 2
     * @return a new function {@code () -> R} that calls
     *      {@code f.call(fl1, fl2)} and returns the result.
     */
    @SuppressWarnings("unchecked") // maven spuriously warns about a type error in this case
    static  net.mintern.functions.nullary.checked.NilToObjE
    bind(FloatFloatToObjE f, float fl1, float fl2) {
        return () -> f.call(fl1, fl2);
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy