binary.checked.CharBoolToCharE 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 (char, boolean) -> char}.
*
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface CharBoolToCharE {
/**
* Performs this operation.
*
* @param ch argument 1
* @param bool argument 2
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
char call(char ch, boolean bool) throws E;
/**
* Binds {@code (ch)} to the beginning of {@code f}, returning a new function
* of type {@code (boolean) -> char}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param ch argument 1
* @return a new function {@code (boolean bool) -> char} that calls
* {@code f.call(ch, bool)} and returns the result.
*/
static net.mintern.functions.unary.checked.BoolToCharE
bind(CharBoolToCharE f, char ch) {
return (bool) -> f.call(ch, bool);
}
/**
* Binds {@code (ch)} to the beginning of {@code this}, returning a new function
* of type {@code (boolean) -> char}.
*
* @param ch argument 1
* @return a new function {@code (boolean bool) -> char} that calls
* {@code this.call(ch, bool)} and returns the result.
*/
default net.mintern.functions.unary.checked.BoolToCharE bind(char ch) {
return CharBoolToCharE.bind(this, ch);
}
/**
* Binds {@code (bool)} to the end of {@code f}, returning a new function
* of type {@code (char) -> char}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param bool argument 2
* @return a new function {@code (char ch) -> char} that calls
* {@code f.call(ch, bool)} and returns the result.
*/
static net.mintern.functions.unary.checked.CharToCharE
rbind(CharBoolToCharE f, boolean bool) {
return (ch) -> f.call(ch, bool);
}
/**
* Binds {@code (bool)} to the end of {@code this}, returning a new function
* of type {@code (char) -> char}.
*
* @param bool argument 2
* @return a new function {@code (char ch) -> char} that calls
* {@code this.call(ch, bool)} and returns the result.
*/
default net.mintern.functions.unary.checked.CharToCharE rbind(boolean bool) {
return CharBoolToCharE.rbind(this, bool);
}
/**
* Binds {@code (ch, bool)} to {@code f}, returning a new function
* of type {@code () -> char}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param ch argument 1
* @param bool argument 2
* @return a new function {@code () -> char} that calls
* {@code f.call(ch, bool)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToCharE
bind(CharBoolToCharE f, char ch, boolean bool) {
return () -> f.call(ch, bool);
}
/**
* Binds {@code (ch, bool)} to {@code this}, returning a new function
* of type {@code () -> char}.
*
* @param ch argument 1
* @param bool argument 2
* @return a new function {@code () -> char} that calls
* {@code this.call(ch, bool)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToCharE bind(char ch, boolean bool) {
return CharBoolToCharE.bind(this, ch, bool);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy