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

binary.checked.FloatLongToIntE Maven / Gradle / Ivy

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

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

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy