binary.checked.BoolIntToObjE Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functions-binary-extended Show documentation
Show all versions of functions-binary-extended Show documentation
Provides functional interfaces for most two-argument functions
package net.mintern.functions.binary.checked;
/**
* An operation of type {@code (boolean, int) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface BoolIntToObjE {
/**
* Performs this operation.
*
* @param bool argument 1
* @param i argument 2
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
R call(boolean bool, int i) throws E;
/**
* Binds {@code (bool)} to the beginning of {@code f}, returning a new function
* of type {@code (int) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param bool argument 1
* @return a new function {@code (int i) -> R} that calls
* {@code f.call(bool, i)} and returns the result.
*/
static net.mintern.functions.unary.checked.IntToObjE
bind(BoolIntToObjE f, boolean bool) {
return (i) -> f.call(bool, i);
}
/**
* Binds {@code (bool)} to the beginning of {@code this}, returning a new function
* of type {@code (int) -> R}.
*
* @param bool argument 1
* @return a new function {@code (int i) -> R} that calls
* {@code this.call(bool, i)} and returns the result.
*/
default net.mintern.functions.unary.checked.IntToObjE bind(boolean bool) {
return BoolIntToObjE.bind(this, bool);
}
/**
* Binds {@code (i)} to the end of {@code f}, returning a new function
* of type {@code (boolean) -> R}.
*
* @param the type of the return value
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param i argument 2
* @return a new function {@code (boolean bool) -> R} that calls
* {@code f.call(bool, i)} and returns the result.
*/
static net.mintern.functions.unary.checked.BoolToObjE
rbind(BoolIntToObjE f, int i) {
return (bool) -> f.call(bool, i);
}
/**
* Binds {@code (i)} to the end of {@code this}, returning a new function
* of type {@code (boolean) -> R}.
*
* @param i argument 2
* @return a new function {@code (boolean bool) -> R} that calls
* {@code this.call(bool, i)} and returns the result.
*/
default net.mintern.functions.unary.checked.BoolToObjE rbind(int i) {
return BoolIntToObjE.rbind(this, i);
}
/**
* Binds {@code (bool, i)} 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 bool argument 1
* @param i argument 2
* @return a new function {@code () -> R} that calls
* {@code f.call(bool, i)} and returns the result.
*/
@SuppressWarnings("unchecked") // maven spuriously warns about a type error in this case
static net.mintern.functions.nullary.checked.NilToObjE
bind(BoolIntToObjE f, boolean bool, int i) {
return () -> f.call(bool, i);
}
/**
* Binds {@code (bool, i)} to {@code this}, returning a new function
* of type {@code () -> R}.
*
* @param bool argument 1
* @param i argument 2
* @return a new function {@code () -> R} that calls
* {@code this.call(bool, i)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToObjE bind(boolean bool, int i) {
return BoolIntToObjE.bind(this, bool, i);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy