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

unary.checked.DblToShortE Maven / Gradle / Ivy

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

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

    /**
     * Performs this operation.
     *
     * @param d the argument
     * @return the result of the operation
     * @throws E if the operation cannot be completed
     */
    short call(double d) throws E;

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy