
net.mintern.functions.unary.checked.FloatToObjE Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functions-unary-extended Show documentation
Show all versions of functions-unary-extended Show documentation
Provides functional interfaces for most two-argument functions
The newest version!
package net.mintern.functions.unary.checked;
/**
* An operation of type {@code (float) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface FloatToObjE {
/**
* Performs this operation.
*
* @param fl the argument
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
R call(float fl) throws E;
/**
* Binds {@code (fl)} to {@code f}, returning a new function
* of type {@code () -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param fl the argument
* @return a new function {@code () -> R} that calls
* {@code f.call(fl)} and returns the result.
*/
@SuppressWarnings("unchecked") // maven spuriously warns about a type error in this case
static net.mintern.functions.nullary.checked.NilToObjE
bind(FloatToObjE f, float fl) {
return () -> f.call(fl);
}
/**
* Binds {@code (fl)} to {@code this}, returning a new function
* of type {@code () -> R}.
*
* @param fl the argument
* @return a new function {@code () -> R} that calls
* {@code this.call(fl)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToObjE bind(float fl) {
return FloatToObjE.bind(this, fl);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy