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

net.mintern.functions.unary.checked.BoolToDblE Maven / Gradle / Ivy

The newest version!
package net.mintern.functions.unary.checked;

/**
 * An operation of type {@code (boolean) -> double}.
 *
 * @param  the {@code Exception} type that the operation may throw
 */
@FunctionalInterface
public interface BoolToDblE {

    /**
     * Performs this operation.
     *
     * @param bool the argument
     * @return the result of the operation
     * @throws E if the operation cannot be completed
     */
    double call(boolean bool) throws E;

    /**
     * Binds {@code (bool)} to {@code f}, returning a new function
     * of type {@code () -> double}.
     *
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param bool the argument
     * @return a new function {@code () -> double} that calls
     *      {@code f.call(bool)} and returns the result.
     */
    static  net.mintern.functions.nullary.checked.NilToDblE
    bind(BoolToDblE f, boolean bool) {
        return () -> f.call(bool);
    }

    /**
     * Binds {@code (bool)} to {@code this}, returning a new function
     * of type {@code () -> double}.
     *
     * @param bool the argument
     * @return a new function {@code () -> double} that calls
     *      {@code this.call(bool)} and returns the result.
     */
    default net.mintern.functions.nullary.checked.NilToDblE bind(boolean bool) {
        return BoolToDblE.bind(this, bool);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy