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

binary.checked.BoolIntToBoolE Maven / Gradle / Ivy

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

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

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

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

    /**
     * Binds {@code (bool)} to the beginning of {@code this}, returning a new function
     * of type {@code (int) -> boolean}.
     *
     * @param bool argument 1
     * @return a new function {@code (int i) -> boolean} that calls
     *      {@code this.call(bool, i)} and returns the result.
     */
    default net.mintern.functions.unary.checked.IntToBoolE bind(boolean bool) {
        return BoolIntToBoolE.bind(this, bool);
    }

    /**
     * Binds {@code (i)} to the end of {@code f}, returning a new function
     * of type {@code (boolean) -> boolean}.
     *
     * @param  the {@code Exception} type that the operation may throw
     * @param f the unbound function
     * @param i argument 2
     * @return a new function {@code (boolean bool) -> boolean} that calls
     *      {@code f.call(bool, i)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.BoolToBoolE
    rbind(BoolIntToBoolE f, int i) {
        return (bool) -> f.call(bool, i);
    }

    /**
     * Binds {@code (i)} to the end of {@code this}, returning a new function
     * of type {@code (boolean) -> boolean}.
     *
     * @param i argument 2
     * @return a new function {@code (boolean bool) -> boolean} that calls
     *      {@code this.call(bool, i)} and returns the result.
     */
    default net.mintern.functions.unary.checked.BoolToBoolE rbind(int i) {
        return BoolIntToBoolE.rbind(this, i);
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy