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