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

net.mintern.functions.binary.checked.IntLongToByteE Maven / Gradle / Ivy

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

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

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

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

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy