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

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

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy