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

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

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

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

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

    /**
     * Binds {@code (l)} to the beginning 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 1
     * @return a new function {@code (int i) -> byte} that calls
     *      {@code f.call(l, i)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.IntToByteE
    bind(LongIntToByteE f, long l) {
        return (i) -> f.call(l, i);
    }

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

    /**
     * Binds {@code (i)} to the end 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 2
     * @return a new function {@code (long l) -> byte} that calls
     *      {@code f.call(l, i)} and returns the result.
     */
    static  net.mintern.functions.unary.checked.LongToByteE
    rbind(LongIntToByteE f, int i) {
        return (l) -> f.call(l, i);
    }

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

    /**
     * Binds {@code (l, i)} 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 l argument 1
     * @param i argument 2
     * @return a new function {@code () -> byte} that calls
     *      {@code f.call(l, i)} and returns the result.
     */
    static  net.mintern.functions.nullary.checked.NilToByteE
    bind(LongIntToByteE f, long l, int i) {
        return () -> f.call(l, i);
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy