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

net.mintern.functions.unary.checked.IntToFloatE Maven / Gradle / Ivy

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

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

    /**
     * Performs this operation.
     *
     * @param i the argument
     * @return the result of the operation
     * @throws E if the operation cannot be completed
     */
    float call(int i) throws E;

    /**
     * Binds {@code (i)} 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 i the argument
     * @return a new function {@code () -> float} that calls
     *      {@code f.call(i)} and returns the result.
     */
    static  net.mintern.functions.nullary.checked.NilToFloatE
    bind(IntToFloatE f, int i) {
        return () -> f.call(i);
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy