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

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

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

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

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

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

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

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

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy