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

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

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

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

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

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

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy