net.mintern.functions.unary.checked.ByteToShortE 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 (byte) -> short}.
*
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface ByteToShortE {
/**
* Performs this operation.
*
* @param b the argument
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
short call(byte b) throws E;
/**
* Binds {@code (b)} 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 b the argument
* @return a new function {@code () -> short} that calls
* {@code f.call(b)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToShortE
bind(ByteToShortE f, byte b) {
return () -> f.call(b);
}
/**
* Binds {@code (b)} to {@code this}, returning a new function
* of type {@code () -> short}.
*
* @param b the argument
* @return a new function {@code () -> short} that calls
* {@code this.call(b)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToShortE bind(byte b) {
return ByteToShortE.bind(this, b);
}
}