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

binary.checked.LongFloatToIntE 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, float) -> int}.
 *
 * @param  the {@code Exception} type that the operation may throw
 */
@FunctionalInterface
public interface LongFloatToIntE {

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

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

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

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

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy