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

binary.checked.LongCharToLongE Maven / Gradle / Ivy

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

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

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy