unary.checked.ShortToNilE Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functions-unary-all Show documentation
Show all versions of functions-unary-all Show documentation
Provides functional interfaces for all two-argument functions
package net.mintern.functions.unary.checked;
/**
* An operation of type {@code (short) -> void}.
*
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface ShortToNilE {
/**
* Performs this operation.
*
* @param sh the argument
* @throws E if the operation cannot be completed
*/
void call(short sh) throws E;
/**
* Binds {@code (sh)} to {@code f}, returning a new function
* of type {@code () -> void}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param sh the argument
* @return a new function {@code () -> void} that calls
* {@code f.call(sh)}.
*/
static net.mintern.functions.nullary.checked.NilToNilE
bind(ShortToNilE f, short sh) {
return () -> f.call(sh);
}
/**
* Binds {@code (sh)} to {@code this}, returning a new function
* of type {@code () -> void}.
*
* @param sh the argument
* @return a new function {@code () -> void} that calls
* {@code this.call(sh)}.
*/
default net.mintern.functions.nullary.checked.NilToNilE bind(short sh) {
return ShortToNilE.bind(this, sh);
}
}