
net.mintern.functions.binary.checked.ByteBoolToIntE 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
The newest version!
package net.mintern.functions.binary.checked;
/**
* An operation of type {@code (byte, boolean) -> int}.
*
* @param the {@code Exception} type that the operation may throw
*/
@FunctionalInterface
public interface ByteBoolToIntE {
/**
* Performs this operation.
*
* @param b argument 1
* @param bool argument 2
* @return the result of the operation
* @throws E if the operation cannot be completed
*/
int call(byte b, boolean bool) throws E;
/**
* Binds {@code (b)} to the beginning of {@code f}, returning a new function
* of type {@code (boolean) -> int}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param b argument 1
* @return a new function {@code (boolean bool) -> int} that calls
* {@code f.call(b, bool)} and returns the result.
*/
static net.mintern.functions.unary.checked.BoolToIntE
bind(ByteBoolToIntE f, byte b) {
return (bool) -> f.call(b, bool);
}
/**
* Binds {@code (b)} to the beginning of {@code this}, returning a new function
* of type {@code (boolean) -> int}.
*
* @param b argument 1
* @return a new function {@code (boolean bool) -> int} that calls
* {@code this.call(b, bool)} and returns the result.
*/
default net.mintern.functions.unary.checked.BoolToIntE bind(byte b) {
return ByteBoolToIntE.bind(this, b);
}
/**
* Binds {@code (bool)} to the end of {@code f}, returning a new function
* of type {@code (byte) -> int}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param bool argument 2
* @return a new function {@code (byte b) -> int} that calls
* {@code f.call(b, bool)} and returns the result.
*/
static net.mintern.functions.unary.checked.ByteToIntE
rbind(ByteBoolToIntE f, boolean bool) {
return (b) -> f.call(b, bool);
}
/**
* Binds {@code (bool)} to the end of {@code this}, returning a new function
* of type {@code (byte) -> int}.
*
* @param bool argument 2
* @return a new function {@code (byte b) -> int} that calls
* {@code this.call(b, bool)} and returns the result.
*/
default net.mintern.functions.unary.checked.ByteToIntE rbind(boolean bool) {
return ByteBoolToIntE.rbind(this, bool);
}
/**
* Binds {@code (b, bool)} to {@code f}, returning a new function
* of type {@code () -> int}.
*
* @param the {@code Exception} type that the operation may throw
* @param f the unbound function
* @param b argument 1
* @param bool argument 2
* @return a new function {@code () -> int} that calls
* {@code f.call(b, bool)} and returns the result.
*/
static net.mintern.functions.nullary.checked.NilToIntE
bind(ByteBoolToIntE f, byte b, boolean bool) {
return () -> f.call(b, bool);
}
/**
* Binds {@code (b, bool)} to {@code this}, returning a new function
* of type {@code () -> int}.
*
* @param b argument 1
* @param bool argument 2
* @return a new function {@code () -> int} that calls
* {@code this.call(b, bool)} and returns the result.
*/
default net.mintern.functions.nullary.checked.NilToIntE bind(byte b, boolean bool) {
return ByteBoolToIntE.bind(this, b, bool);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy